zsh: Add bash-like alt-dot hotkey

Allows pressing <alt-.> when in insertion mode in zsh to add the first
(then second, third, ...) argument from the last line to the end of the
current line.

Especially useful for things like:

```
mkdir -p my/folder/deeply nested
cd <alt-.>
```

to instantly move to the folder!
This commit is contained in:
Marty Oehme 2020-10-21 17:09:48 +02:00
parent ebb937a0e3
commit 454073b408
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -143,6 +143,10 @@ bindkey " " globalias
bindkey "^ " magic-space # control-space to bypass completion
bindkey -M isearch " " magic-space # normal space during searches
# allow inserting previous arguments in the current zle input
# see https://stackoverflow.com/a/34861762
bindkey "^[." insert-last-word
# VIM MODE for the shell
# enable vim mode on pressing escape
bindkey -v