zsh: set bindings without zvm

This commit is contained in:
surtur 2023-09-08 16:04:11 +02:00
parent 48d511befb
commit ecead9eac4
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -1,21 +1,18 @@
# as per https://github.com/jeffreytse/zsh-vi-mode#execute-extra-commands # map Del escape sequence to actual Del key in all (n,i) modes to resemble vim instead of vi
function zvm_after_lazy_keybindings() { bindkey -a '^[[3~' delete-char
# map Del escape sequence to actual Del key in all (n,i) modes to resemble vim instead of vi # map arrow up/down to control fish-like history substring search and highlighting
bindkey -a '^[[3~' delete-char bindkey '^[[A' history-substring-search-up
# map arrow up/down to control fish-like history substring search and highlighting bindkey '^[[B' history-substring-search-down
bindkey '^[[A' history-substring-search-up bindkey '^o' fzf-open
bindkey '^[[B' history-substring-search-down # also map the same keys in 'viins' (INSERT) mode...
bindkey '^o' fzf-open bindkey -M viins '^[[A' history-substring-search-up
# also map the same keys in 'viins' (INSERT) mode... bindkey -M viins '^[[B' history-substring-search-down
bindkey -M viins '^[[A' history-substring-search-up bindkey -M viins '^o' fzf-open
bindkey -M viins '^[[B' history-substring-search-down # ...and in 'vicmd' (NORMAL) mode...
bindkey -M viins '^o' fzf-open bindkey -M vicmd '^[[A' history-substring-search-up
# ...and in 'vicmd' (NORMAL) mode... bindkey -M vicmd '^[[B' history-substring-search-down
bindkey -M vicmd '^[[A' history-substring-search-up # ...and as well to K, J, instead of arrow up/down, respectively.
bindkey -M vicmd '^[[B' history-substring-search-down # note these are capital letters, original behaviour of j, k is left unchanged
# ...and as well to K, J, instead of arrow up/down, respectively. bindkey -M vicmd 'K' history-substring-search-up
# note these are capital letters, original behaviour of j, k is left unchanged bindkey -M vicmd 'J' history-substring-search-down
bindkey -M vicmd 'K' history-substring-search-up bindkey '^\' accept-and-hold
bindkey -M vicmd 'J' history-substring-search-down
bindkey '^\' accept-and-hold
}