|
1 | | -*smart-splits.txt* Last change: 2024 March 11 |
| 1 | +*smart-splits.txt* Last change: 2024 April 27 |
2 | 2 |
|
3 | 3 | ============================================================================== |
4 | 4 | Table of Contents *smart-splits-table-of-contents* |
@@ -484,39 +484,37 @@ KITTY *smart-splits-kitty* |
484 | 484 | [!NOTE] The `config.at_edge = 'wrap'` option is not supoprted in Kitty |
485 | 485 | terminal multiplexer due to inability to determine pane layout from CLI. |
486 | 486 |
|
| 487 | +By default the plugin sets a kitty user-var `IS_NVIM` when it loads. You can |
| 488 | +take advantage of this together with kittys conditional mappings feature |
| 489 | +<https://sw.kovidgoyal.net/kitty/mapping/#conditional-mappings-depending-on-the-state-of-the-focused-window> |
| 490 | +to use the same keybind for both kitty and neovim. |
| 491 | + |
487 | 492 | Add the following snippet to `~/.config/kitty/kitty.conf`, adjusting the |
488 | 493 | keymaps and resize amount as desired. |
489 | 494 |
|
490 | 495 | > |
491 | | - map ctrl+j kitten pass_keys.py neighboring_window bottom ctrl+j |
492 | | - map ctrl+k kitten pass_keys.py neighboring_window top ctrl+k |
493 | | - map ctrl+h kitten pass_keys.py neighboring_window left ctrl+h |
494 | | - map ctrl+l kitten pass_keys.py neighboring_window right ctrl+l |
495 | 496 | |
496 | | - # the 3 here is the resize amount, adjust as needed |
497 | | - map alt+j kitten pass_keys.py relative_resize down 3 alt+j |
498 | | - map alt+k kitten pass_keys.py relative_resize up 3 alt+k |
499 | | - map alt+h kitten pass_keys.py relative_resize left 3 alt+h |
500 | | - map alt+l kitten pass_keys.py relative_resize right 3 alt+l |
501 | | -< |
502 | | -By default the plugin sets a kitty user-var `IS_NVIM` when it loads. You can take advantage of this together with kittys |
503 | | -[conditional mappings feature](https://sw.kovidgoyal.net/kitty/mapping/#conditional-mappings-depending-on-the-state-of-the-focused-window) |
504 | | - |
505 | 497 | map ctrl+j neighboring_window down |
506 | 498 | map ctrl+k neighboring_window up |
507 | 499 | map ctrl+h neighboring_window left |
508 | 500 | map ctrl+l neighboring_window right |
509 | | - |
| 501 | + |
| 502 | + # Unset the mapping to pass the keys to neovim |
510 | 503 | map --when-focus-on var:IS_NVIM ctrl+j |
511 | 504 | map --when-focus-on var:IS_NVIM ctrl+k |
512 | 505 | map --when-focus-on var:IS_NVIM ctrl+h |
513 | 506 | map --when-focus-on var:IS_NVIM ctrl+l |
514 | | - |
| 507 | + |
515 | 508 | # the 3 here is the resize amount, adjust as needed |
516 | | - map alt+j kitten pass_keys.py relative_resize down 3 alt+j "^.* - nvim$" |
517 | | - map alt+k kitten pass_keys.py relative_resize up 3 alt+k "^.* - nvim$" |
518 | | - map alt+h kitten pass_keys.py relative_resize left 3 alt+h "^.* - nvim$" |
519 | | - map alt+l kitten pass_keys.py relative_resize right 3 alt+l "^.* - nvim$" |
| 509 | + map alt+j kitten relative_resize down 3 |
| 510 | + map alt+k kitten relative_resize up 3 |
| 511 | + map alt+h kitten relative_resize left 3 |
| 512 | + map alt+l kitten relative_resize right 3 |
| 513 | + |
| 514 | + map --when-focus-on var:IS_NVIM alt+j |
| 515 | + map --when-focus-on var:IS_NVIM alt+k |
| 516 | + map --when-focus-on var:IS_NVIM alt+h |
| 517 | + map --when-focus-on var:IS_NVIM alt+l |
520 | 518 | < |
521 | 519 | Then, you must allow Kitty to listen for remote commands on a socket. You can |
522 | 520 | do this either by running Kitty with the following command: |
@@ -575,4 +573,4 @@ currently in use. The API offers the following methods: |
575 | 573 | ---@field type 'tmux'|'wezterm'|'kitty' |
576 | 574 | < |
577 | 575 |
|
578 | | -vim:tw=78:ts=8:ft=help:norl: |
| 576 | +vim:tw=78:ts=8:ft=help:norl: |
0 commit comments