Wednesday, February 16, 2011

Re: How to move to beginning of command line



On Wednesday, February 16, 2011 11:30:55 AM UTC-7, Tim Chase wrote:
On 02/16/2011 12:04 PM, Jeremy wrote:
> When typing a command, (i.e., su/.../.../) how can I jump
> around on the command line without using the arrow keys.  That
> is, how can I jump to the beginning, or the end, or move
> backward/forward?  In a terminal, I can just use the CTRL-A
> and CTRL-E to go to the beginning and end of the command.  Is
> there something similar in Vim?

I believe, only <home> does that, but since I don't use the stock
functionality of ^A in the command-line, I occasionally remap it:

   :cnoremap <c-a> <home>

which makes it behave as you expect.  ^E already should behave as
you expect:

   :help c_CTRL-E

Currently ^B is set to act as home, but my bash-fingers never
reach for that, so it might also help to add

   :cnoremap <c-b> <left>
   :cnoremap <c-f> <right>
   :cnoremap <m-f> <c-right>
   :cnoremap <m-b> <c-left>



Excellent.  Now my Vim and my bash will act the same
Jeremy 

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