[zsh] Enable command line editing in vim
Needs vim-mode enabled for zsh (which it is in this zshrc). When in normal mode press <space> to move the current command into vim and edit it.
This commit is contained in:
parent
c8f9d31312
commit
3e2d17aa5f
1 changed files with 6 additions and 1 deletions
|
@ -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/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
|
||||||
source /usr/share/nvm/init-nvm.sh
|
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
|
compinit
|
||||||
|
|
||||||
# shellcheck source=alias
|
# shellcheck source=alias
|
||||||
|
@ -129,6 +130,10 @@ bindkey '^N' down-line-or-history
|
||||||
# search history backwards <c-r>
|
# search history backwards <c-r>
|
||||||
bindkey '^r' history-incremental-search-backward
|
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
|
# Deduplicate PATH - remove any duplicate entries from PATH
|
||||||
# from: https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command
|
# from: https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command
|
||||||
get_var() {
|
get_var() {
|
||||||
|
|
Loading…
Reference in a new issue