feat(smart-splits): integrate with smart-splits in neovim

Allows smart-splits in neovim to control certain keymaps for seamless integration

These changes are necessary for the functionality in smart-splits
This commit is contained in:
2024-08-08 22:36:04 -04:00
parent f7546a79e9
commit 999801876b
4 changed files with 215 additions and 9 deletions
+37 -9
View File
@@ -82,11 +82,32 @@ map shift+left move_window left
map shift+right move_window right
map shift+down move_window down
# Switch focus to the neighboring window in the indicated direction
map alt+left neighboring_window left
map alt+right neighboring_window right
map alt+up neighboring_window up
map alt+down neighboring_window down
map alt+shift+k move_window up
map alt+shift+h move_window left
map alt+shift+l move_window right
map alt+shift+j move_window down
map --when-focus-on var:IS_NVIM alt+shift+j
map --when-focus-on var:IS_NVIM alt+shift+k
map --when-focus-on var:IS_NVIM alt+shift+h
map --when-focus-on var:IS_NVIM alt+shift+l
# the 3 here is the resize amount, adjust as needed
map alt+j kitten relative_resize.py down 3
map alt+k kitten relative_resize.py up 3
map alt+h kitten relative_resize.py left 3
map alt+l kitten relative_resize.py right 3
map --when-focus-on var:IS_NVIM alt+j
map --when-focus-on var:IS_NVIM alt+k
map --when-focus-on var:IS_NVIM alt+h
map --when-focus-on var:IS_NVIM alt+l
### Smart Resize ###
map alt+r start_resizing_window
map --when-focus-on var:IS_NVIM alt+r
# Detach Windows
# moves the window into a new OS window
@@ -101,10 +122,17 @@ map ctrl+f4 detach_window tab-prev
map kitty_mod+/ launch --location=hsplit --allow-remote-control kitty +kitten kitty_search/search.py @active-kitty-window-id
### NVim Plugins
map ctrl+shift+j kitten pass_keys.py neighboring_window bottom ctrl+shift+j
map ctrl+shift+k kitten pass_keys.py neighboring_window top ctrl+shift+k
map ctrl+shift+h kitten pass_keys.py neighboring_window left ctrl+shift+h
map ctrl+shift+l kitten pass_keys.py neighboring_window right ctrl+shift+l
map ctrl+shift+j neighboring_window down
map ctrl+shift+k neighboring_window up
map ctrl+shift+h neighboring_window left
map ctrl+shift+l neighboring_window right
# Unset the mapping to pass the keys to neovim
map --when-focus-on var:IS_NVIM ctrl+shift+j
map --when-focus-on var:IS_NVIM ctrl+shift+k
map --when-focus-on var:IS_NVIM ctrl+shift+h
map --when-focus-on var:IS_NVIM ctrl+shift+l
## NVim Kitty Scrollback
# Browse scrollback buffer in nvim