diff options
author | Josh Rahm <rahm@google.com> | 2023-01-30 22:57:37 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2023-01-30 22:57:37 +0000 |
commit | 44b08b3dd42016812843b6100c719c936e2bc030 (patch) | |
tree | 1d3d71fcd83404b4cde9446ff2085bfd78510ab3 | |
parent | 3a7d5e7b33fc02441b4083962df024b18d66ef6e (diff) | |
download | zshrcd-44b08b3dd42016812843b6100c719c936e2bc030.tar.gz zshrcd-44b08b3dd42016812843b6100c719c936e2bc030.tar.bz2 zshrcd-44b08b3dd42016812843b6100c719c936e2bc030.zip |
Better integration with nvim to use ctrl W.
-rw-r--r-- | 98-bindkeys.zsh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/98-bindkeys.zsh b/98-bindkeys.zsh index a68502d..6ff8c63 100644 --- a/98-bindkeys.zsh +++ b/98-bindkeys.zsh @@ -86,6 +86,15 @@ nvim-complete-lst() { compadd "good" "day" "sir" } +nvim-viins-ctrl-w() { + if [[ "$BUFFER" == "" ]] ; then + zle vi-cmd-mode + nvim-move-pane + else + zle vi-backward-kill-word + fi +} + zle -C nvim-complete menu-select nvim-complete-lst zle -N nvim-move-pane @@ -93,10 +102,12 @@ zle -N nvim-cmd-mode zle -N expand-last-file zle -N select-nvim-reg zle -N put-after-reg-override +zle -N nvim-viins-ctrl-w bindkey -M vicmd '' nvim-move-pane bindkey -M vicmd ':' nvim-cmd-mode bindkey -M viins '' expand-last-file +bindkey -M viins '' nvim-viins-ctrl-w # Allow selecting and pasting registers from neovim using @<reg>p bindkey -M vicmd '@' select-nvim-reg |