aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2023-01-30 23:14:40 +0000
committerJosh Rahm <rahm@google.com>2023-01-30 23:14:40 +0000
commitc9628d220211e98ad8c8b67a2e67186405ba7515 (patch)
treebc53f3bd0e22c1bbeb6cfaad847fd248d53e3da2
parent44b08b3dd42016812843b6100c719c936e2bc030 (diff)
downloadzshrcd-c9628d220211e98ad8c8b67a2e67186405ba7515.tar.gz
zshrcd-c9628d220211e98ad8c8b67a2e67186405ba7515.tar.bz2
zshrcd-c9628d220211e98ad8c8b67a2e67186405ba7515.zip
feat(bindkeys): ability to navigate neovim tabs from vicmd.
-rw-r--r--98-bindkeys.zsh16
1 files changed, 16 insertions, 0 deletions
diff --git a/98-bindkeys.zsh b/98-bindkeys.zsh
index 6ff8c63..d89126d 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() {
@@ -96,7 +106,10 @@ nvim-viins-ctrl-w() {
}
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
@@ -104,10 +117,13 @@ 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