zsh: ZLE improvements (yank, edit-command-line, clear-status-line)

This commit is contained in:
Fernando Schauenburg 2024-07-27 10:38:27 +02:00
parent aeee2648ca
commit 92089a01ee

View file

@ -39,6 +39,7 @@ bindkey -M viins '^a' vi-beginning-of-line
bindkey -M viins '^e' vi-end-of-line
bindkey -M viins '^l' clear-screen
bindkey -M viins '^u' kill-whole-line
bindkey -M viins '^y' yank
bindkey -M viins '^[.' insert-last-word
# Search through history in insert mode.
@ -49,6 +50,18 @@ bindkey -M viins '^k' history-beginning-search-backward
bindkey -M viins '^[b' vi-backward-word
bindkey -M viins '^[f' vi-forward-word
# Edit current command line in $EDITOR.
autoload edit-command-line && zle -N edit-command-line
bindkey -M viins '^x^e' edit-command-line
bindkey -M vicmd ' ' edit-command-line
clear-status-line() {
zle -R -c
# zle -R hello world and the rest
}
zle -N clear-status-line
bindkey -M viins '^q' clear-status-line
# Shortcut to start neovim.
bindkey -s '^v' '^unvim\r'