Make zsh alt-f behave like emacs alt-f

zsh

In emacs, M-f moves the caret to the end of the next word. In zsh, M-f (or rather alt-f) moves the caret to the beginning of the next word.

For a more consistent experience, I'd like to have zsh alt-f mirror emacs behavior.

How can I do this?

Best Answer

bindkey '\ef' emacs-forward-word

See:

zle -la | grep word

to list the widgets that contain the word word.

info --index-search=emacs-forward-word zsh

to get the documentation on a given widget.