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

Re: [PATCH] ZLE: Bind '_' to vi-first-non-blank in vicmd keymap



On 7 Dec, Aidan Van Duyne wrote:
> In vim/vi, '_' moves to the first non-blank character of a line.
> Zsh's vi-mode already provides `vi-first-non-blank` support. This
> is currently bound to '^' in the keymap. This patch binds '_' to
> `vi-first-non-blank` in the vicmd keymap so that Zsh behavior matches
> vim/vi expectations.

Thanks, I have pushed this.

In vi/vim, ^ and _ do actually differ slightly given a numeric argument.
It is ignored with ^ but moves down a line with _ and a count of 2
or more. + does much the same but with lines counted more normally.
Having zsh replicate this would probably be taking vi compatibility too
far. I'd guess _ is mostly useful for people that have a keyboard that
doesn't make ^ easy to access or where it operates as a dead key.

Oliver



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