zsh, I have alt+. bound to
When I am listing through the last command parameters by repeatedly pressing alt+., sometimes I press one too many and I need to go one back.
What keybinding is used to go back?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You can just
undo, bound to Ctrl+_ in
emacs mode by default (note that
insert-last-word is also bound to Alt+_).
undoing though, if you invoke
insert-last-word again, you'll be back to the beginning, you can't just alternate pressing Ctrl+_ and Alt+_ to go back and forth in the history.
For that, you'd need to define a separate widget that invokes the
insert-last-word widget with
1 as argument (see
info zsh insert-last-word for details).
For instance, bound to Alt+,:
insert-last-word-forward() zle insert-last-word 1 zle -N insert-last-word-forward bindkey '\e,' insert-last-word-forward