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

Re: vi bindings



On Sat, Jan 3, 2009 at 8:43 PM, Richard Hartmann wrote:
> On Sun, Jan 4, 2009 at 02:17, Mikael Magnusson wrote:
>
>> Vim and Vi do not differ wrt to backspacing in the default
>> configuration. (try vim -u /dev/null).
>
> In compatible mode, backspace in insert mode moves one
> char to the left. In nocompatible mode it actually deletes the
> char on the left of the cursor. Both in insert mode and with
> standard settings.

In both compatible and nocompatible mode, backspace in insert mode
deletes the character before the cursor, BUT...  in compatible mode,
it will not delete past the point where insertion started, or over a
line break, or (and this one doesn't really apply to zsh) over
automatically inserted indentation.  With both "vim -u NONE -C" and
"vim -u NONE -N", ihell<Esc>ao<BS> leaves "hell", but in compatible
mode ihello<Esc>a<BS> rings the bell and leaves "hello", and in
nocompatible mode it leaves just "hell".

In normal mode, <BS> moves one character left in each, but in
compatible mode it will not move across line breaks, and in
nocompatible mode it will.

All that being said, the OP will likely find that to make the vi
keymap behave as he wants, he can override some of the keys with the
emacs equivalents and get vimmier behavior.

~Matt



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