From 3e2d17aa5fac6a5d5b88c313c9acffdb9dbfa0c9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 5 May 2020 22:27:17 +0200 Subject: [PATCH] [zsh] Enable command line editing in vim Needs vim-mode enabled for zsh (which it is in this zshrc). When in normal mode press to move the current command into vim and edit it. --- zsh/.config/zsh/.zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 2858d9a..6da9b9d 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -31,7 +31,8 @@ source /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.z source /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh source /usr/share/nvm/init-nvm.sh -autoload -Uz compinit zmv +# load completion, extended zsh moving syntax, zle edit in vim (or other $EDITOR) possibility +autoload -Uz compinit zmv edit-command-line compinit # shellcheck source=alias @@ -129,6 +130,10 @@ bindkey '^N' down-line-or-history # search history backwards bindkey '^r' history-incremental-search-backward +# Send command to editor and back for execution +zle -N edit-command-line +bindkey -M vicmd ' ' edit-command-line + # Deduplicate PATH - remove any duplicate entries from PATH # from: https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command get_var() {