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

Re: vi-mode zle: how to delete past the start char of insert mode (like VIM 'backspace'=start option)



On Sun, 27 Sep 2009 16:03:53 +0200
Anton Sharonov <anton.sharonov@xxxxxxxxx> wrote:
> How can I tell zshzle that I like to be able to delete past the
> point of _start_ of the insert mode ?

Replace the "vi-" style bindings with the non-vi equivalents, which
don't care about the insertion point.

bindkey -M viins '^h' backward-delete-char
bindkey -M viins '^?' backward-delete-char
bindkey -M viins '^w' backward-kill-word

etc.

You can be a bit smarter by replacing the widgets themselves,

zle -A .backward-kill-word vi-backward-kill-word
zle -A .backward-delete-char vi-backward-delete-char

which means you don't need to worry about what they're bound to them.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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