Friday, April 27, 2012

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

On Friday, April 27, 2012 2:48:06 PM UTC-4, Tim Chase wrote:
> On 04/27/12 13:35, pixelterra wrote:
> > "Suppose you typed a longer command and you noticed that you
> > had made several mistakes, and wanted to do the correction in
> > the vi editor itself. You can type 'v' to edit the command in
> > the editor and not on the command line!"
>
> Are you sure you mean typing "v" to edit the command? Usually it
> defaults to control+F on the command-line (assuming you haven't
> changed the value for 'cedit', something I don't recommend
> doing). This opens the command-line window. It should keep
> 'history' entries around (defaulting to 20)
>
> :help cmdwin
> :help 'history'
> :help 'cedit'
>
> If you want to get to this window again, you can either press the
> colon followed by control+F. Alternatively, you can use
>
> q:
>
> to open the window. Similar editing can be done on search
> history with "q/" or pressing control+F in a "/" or "?" search
> you've already started.
>
> To navigate, you can scroll back using normal Vi navigation
> (searching, h/j/k/l, etc)
>
> > 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?
>
> You can recall previous commands using control+P (and control+N)
> or <up>/<down>, as well as using Vim navigation in the
> command-line window as mentioned above.
>
> -tim



On Friday, April 27, 2012 2:48:06 PM UTC-4, Tim Chase wrote:
> On 04/27/12 13:35, pixelterra wrote:
> > "Suppose you typed a longer command and you noticed that you
> > had made several mistakes, and wanted to do the correction in
> > the vi editor itself. You can type 'v' to edit the command in
> > the editor and not on the command line!"
>
> Are you sure you mean typing "v" to edit the command? Usually it
> defaults to control+F on the command-line (assuming you haven't
> changed the value for 'cedit', something I don't recommend
> doing). This opens the command-line window. It should keep
> 'history' entries around (defaulting to 20)
>
> :help cmdwin
> :help 'history'
> :help 'cedit'
>
> If you want to get to this window again, you can either press the
> colon followed by control+F. Alternatively, you can use
>
> q:
>
> to open the window. Similar editing can be done on search
> history with "q/" or pressing control+F in a "/" or "?" search
> you've already started.
>
> To navigate, you can scroll back using normal Vi navigation
> (searching, h/j/k/l, etc)
>
> > 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?
>
> You can recall previous commands using control+P (and control+N)
> or <up>/<down>, as well as using Vim navigation in the
> command-line window as mentioned above.
>
> -tim

Tim, I mean I'm on the linux command line in set -o vi mode.

You can do basic editing there, but anything more complex you can type 'v' and it will open the current command line text in $EDITOR. I'm wondering how to send the edited command back to the LINUX command line (not inside of vim)

--
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

No comments: