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

Re: emacs-forward-word not emacs-like



> On Oct 20, 2020, at 11:28 PM, Nathan Phillip Brink <ohnobinki@xxxxxxxxxxxxxxxxxx> wrote:
> 
> If my cursor is positioned at ‘a’ and I press M-f, bash and Emacs
> will move the cursor to point to the first dash ‘-’ (dash) (i.e., to
> immediately after the ‘a’). zsh’s emacs-forward-word will instead
> position the cursor immediately after ‘c’. M-b mapped to
> emacs-backward-word and M-d mapped to kill-word suffer from the same
> issue where dashes and other punctuation(?) are incorrectly considered
> to be word characters.
> 
> Since I am so used to the behavior of Emacs and bash, this divergent
> behavior of zsh for these keys is really disruptive.
> 
> Is there a way to get Emacs/bash-style cursor movement for these
> bindings?

Take a look at the WORDCHARS shell variable and try removing any
characters that don't strike your fancy.

vq



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