Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vi command line editing



Stephen Marley wrote:
>You see, my fingers are tuned to using the older vi's (eg SunOS's) where
>movement using the arrow keys doesn't work in insert mode.

Arrow keys don't properly `work' in insert mode in *any* vi, since there
is no such thing as an insert `mode'.

>        I have always map!ed the arrow keys to <esc>l or <esc>k etc so
>that they take me into command mode and then move. 

You can do much the same thing with zsh:

bindkey -s "^[[A" "^[k"
bindkey -s "^[[B" "^[j"
bindkey -s "^[[C" "^[l"
bindkey -s "^[[D" "^[h"

bindkey -s acts like vi's map command.  The recent betas can do this
in a slightly better way, but I think this is exactly the functionality
you're looking for.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author