Files
kitty-config/keymaps.conf
T
rootiest 999801876b 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
2024-08-08 22:36:04 -04:00

146 lines
5.7 KiB
Plaintext

# vim:fileencoding=utf-8:foldmethod=marker
#
# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓████████▓▒░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░
# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░
# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░
# ░▒▓███████▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██████▓▒░
# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░
# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░
# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░
#
# ▄████▄ ▒█████ ███▄ █ █████▒
# ▒██▀ ▀█ ▒██▒ ██▒ ██ ▀█ █ ▓██ ▒
# ▒▓█ ▄ ▒██░ ██▒▓██ ▀█ ██▒▒████ ░
# ▒▓▓▄ ▄██▒▒██ ██░▓██▒ ▐▌██▒░▓█▒ ░
# ▒ ▓███▀ ░░ ████▓▒░▒██░ ▓██░░▒█░
# ░ ░▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ▒ ▒ ▒ ░
# ░ ▒ ░ ▒ ▒░ ░ ░░ ░ ▒░ ░
# ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░
# ░ ░ ░ ░ ░
# ░
#
# _..---...,""-._ ,/}/)
# .'' , ``..'(/-<
# / _ { ) \
# ; _ `. `. < a(
# ,' ( \ ) `. \ __.._ .: y
# ( <\_-) )'-.____...\ `._ //-'
# `. `-' /-._))) `-._)))
# `...'
### Keymaps ###
# Markers: Add/remove
map f1 create_marker
map f2 remove_marker
# Toggle default markers
map f3 toggle_marker itext 2 ERROR 1 WARNING 3 PASS
# Save the current session
map f11 launch --type=background ~/.config/kitty/save_session/save_session.sh
# Reload config
map f12 load_config_file
# Clipboard functions
map kitty_mod+c copy_to_clipboard
map kitty_mod+v paste_from_clipboard
map kitty_mod+s paste_from_selection
map shift+insert paste_from_selection
map kitty_mod+o pass_selection_to_program
# Tab switching
map kitty_mod+right next_tab
map ctrl+tab next_tab
map kitty_mod+right next_tab
map ctrl+tab next_tab
map kitty_mod+q close_tab
# Create a new window splitting the space used by the existing one so that
# the two windows are placed one above the other
map f5 launch --location=hsplit
# Create a new window splitting the space used by the existing one so that
# the two windows are placed side by side
map f6 launch --location=vsplit
# Create a new window splitting the space used by the existing one so that
# the two windows are placed side by side if the existing window is wide or
# one above the other if the existing window is tall.
map f4 launch --location=split
# Rotate the current split, changing its split axis from vertical to
# horizontal or vice versa
map f7 layout_action rotate
# Open nvim in a new tab
map f8 launch_tab nvim
map kitty_mod+n launch_tab nvim
# Move the active window in the indicated direction
map shift+up move_window up
map shift+left move_window left
map shift+right move_window right
map shift+down move_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
map kitty_mod+f2 detach_window
# moves the window into a new tab
map kitty_mod+f3 detach_window new-tab
# moves the window into the previously active tab
map ctrl+f4 detach_window tab-prev
### Kittens ###
#kitty-search
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 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
map kitty_mod+b kitty_scrollback_nvim
map f1 kitty_scrollback_nvim
# Browse output of the last shell command in nvim
map kitty_mod+b kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
# Show clicked command output in nvim
mouse_map kitty_mod+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output