Loading ...
Sorry, an error occurred while loading the content.
 

Re: how to send command back to the command line after typing 'v' from linux command line in set -o vi mode?

Expand Messages
  • Taylor Hedberg
    ... When you save the buffer and quit the editor, the shell then executes the contents of the saved buffer. So it happens automatically.
    Message 1 of 11 , Apr 27, 2012
      pixelterra, Fri 2012-04-27 @ 11:35:39-0700:
      > But after I edit the command in vim, how do I get that command back to
      > the command line? Or do I have to copy / paste manually?

      When you save the buffer and quit the editor, the shell then executes
      the contents of the saved buffer. So it happens automatically.
    • Gary Johnson
      ... What do you mean, this doesn t work ? If you mean you still want to have the edited command on the command line and not executed when you exit vim, I
      Message 2 of 11 , Apr 27, 2012
        On 2012-04-27, pixelterra wrote:
        > Actually, I was wrong, this doesn't work. Sorry for the confusion.
        > Any other options?

        What do you mean, "this doesn't work"? If you mean you still want
        to have the edited command on the command line and not executed when
        you exit vim, I don't think bash lets you do that, but I've heard
        zsh does.

        I usually just exit with :wq or ZZ and let bash execute it.

        Regards,
        Gary

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • John Little
        ... It should. Have you got any of VISUAL, EDITOR or FCEDIT set? (A pitfall is to set one of these to just gvim , which won t work, gvim -f is needed.) Is
        Message 3 of 11 , Apr 28, 2012
          On Saturday, April 28, 2012 7:00:43 AM UTC+12, pixelterra wrote:
          > Actually, I was wrong, this doesn't work. Sorry for the confusion. Any other options?

          It should. Have you got any of VISUAL, EDITOR or FCEDIT set? (A pitfall is to set one of these to just "gvim", which won't work, "gvim -f" is needed.) Is TMPDIR set?

          Does vim open in your terminal window? What file is it using? (mine uses /tmp/bash-fc-nnnnnnnnnnn where nnnnnnnnnnn appears to be generated randomly).

          You might try setting EDITOR="vim -u NONE" to eliminate the possibility of a .vimrc or plugin interfering.

          Regards, John

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.