From 454073b408d86e8c51f7f5b4498a32a0c8871b70 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 21 Oct 2020 17:09:48 +0200 Subject: [PATCH] zsh: Add bash-like alt-dot hotkey Allows pressing 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 ``` to instantly move to the folder! --- zsh/.config/zsh/.zshrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 29425d3..1f24c5a 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -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