aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--98-bindkeys.zsh27
1 files changed, 27 insertions, 0 deletions
diff --git a/98-bindkeys.zsh b/98-bindkeys.zsh
index 1dd2842..1c20068 100644
--- a/98-bindkeys.zsh
+++ b/98-bindkeys.zsh
@@ -23,6 +23,16 @@ nvim-move-pane() {
nvimctl feedkeys "$key"
}
+# Changes the tab in the parent Neovim process.
+nvim-move-tab() {
+ nvimctl feedkeys "gt"
+}
+
+# Changes the tab in the parent Neovim process.
+nvim-move-tab-back() {
+ nvimctl feedkeys "gT"
+}
+
# Does anyone actually use the execute prompt in zsh? Rebind to go directly to
# the neovim command prompt.
nvim-cmd-mode() {
@@ -86,17 +96,34 @@ 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 -C files-complete menu-select _files
+zle -N nvim-move-tab
+zle -N nvim-move-tab-back
zle -N nvim-move-pane
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 'gt' nvim-move-tab
+bindkey -M vicmd 'gT' nvim-move-tab-back
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
+bindkey -M viins '' files-complete
# Allow selecting and pasting registers from neovim using @<reg>p
bindkey -M vicmd '@' select-nvim-reg