mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 11:32:42 +00:00
101 lines
4.0 KiB
Bash
101 lines
4.0 KiB
Bash
# ── tmux.conf · kitty as a tmux host ──
|
|
# Kitty is a dumb terminal here: tmux owns panes, windows and sessions.
|
|
# Every structural chord from kitty.conf is re-sent as a tmux key sequence
|
|
# (prefix ctrl+b == byte \x02); an uppercase letter after the prefix byte is
|
|
# the shift variant (\x02H == prefix+shift+h). Actions tmux has no binding
|
|
# for run as out-of-band `tmux` client commands (ctrl+shift+g/e/p).
|
|
# Launched from the default config with ctrl+shift+t.
|
|
|
|
# ── base / appearance (kitty.conf parity) ──
|
|
font_family VictorMono Nerd Font
|
|
bold_italic_font auto
|
|
window_padding_width 8
|
|
hide_window_decorations yes
|
|
background_opacity 0.9
|
|
copy_on_select auto
|
|
strip_trailing_spaces smart
|
|
confirm_os_window_close 0
|
|
allow_remote_control socket-only
|
|
listen_on unix:@kitty-tmux
|
|
cursor_trail 10
|
|
cursor_trail_start_threshold 0
|
|
cursor_trail_decay 0.01 0.05
|
|
cursor_blink_interval 0
|
|
|
|
# tmux renders its own status line (tmux-dotbar, top) — no kitty chrome
|
|
tab_bar_style hidden
|
|
|
|
# one tmux session per kitty window: cold start boots the server and runs
|
|
# tmux-resurrect restore, warm start claims the oldest detached session
|
|
shell kitty-tmux
|
|
|
|
# kitty must not shadow tmux, so every kitty default shortcut is dropped and
|
|
# only what tmux cannot do is re-added below
|
|
clear_all_shortcuts yes
|
|
|
|
# ── kitty-level keys (no tmux equivalent) ──
|
|
map ctrl+shift+c copy_to_clipboard
|
|
map ctrl+shift+v paste_from_clipboard
|
|
map ctrl+plus change_font_size current +1
|
|
map ctrl+minus change_font_size current -1
|
|
map ctrl+0 change_font_size current 0
|
|
map ctrl+shift+alt+, load_config_file
|
|
map ctrl+shift+a launch --type=background --cwd=current kitty --config ~/.config/kitty/herdr.conf
|
|
|
|
# ── kitty tabs → tmux windows ──
|
|
map super+t send_text all \x02t
|
|
map super+enter send_text all \x02t
|
|
map ctrl+shift+t send_text all \x02t
|
|
map ctrl+shift+h send_text all \x02H
|
|
map ctrl+shift+k send_text all \x02L
|
|
map alt+q send_text all \x021
|
|
map alt+w send_text all \x022
|
|
map alt+e send_text all \x023
|
|
map alt+r send_text all \x024
|
|
map alt+t send_text all \x025
|
|
map alt+y send_text all \x026
|
|
map alt+u send_text all \x027
|
|
map alt+i send_text all \x028
|
|
map alt+o send_text all \x029
|
|
|
|
# ── kitty splits → tmux panes ──
|
|
map ctrl+shift+j send_text all \x02"
|
|
map ctrl+shift+l send_text all \x02%
|
|
map ctrl+enter send_text all \x02%
|
|
map ctrl+shift+f send_text all \x02z
|
|
map ctrl+shift+w send_text all \x02x
|
|
map super+w send_text all \x02x
|
|
# resize: prefix + ctrl+arrow == tmux resize-pane (repeatable)
|
|
map super+left send_text all \x02\x1b[1;5D
|
|
map super+right send_text all \x02\x1b[1;5C
|
|
map super+up send_text all \x02\x1b[1;5A
|
|
map super+down send_text all \x02\x1b[1;5B
|
|
|
|
# ctrl+h/j/k/l are tmux's vim-aware pane navigation and ctrl+space is
|
|
# tmux-palette — both no-prefix tmux binds, so kitty must not grab them.
|
|
# No maps for those live in this config (splits stay on ctrl+shift+j/l).
|
|
|
|
# ── launchers: no tmux bind exists for these ──
|
|
# Driving the prefix command prompt (\x02: … \r) does NOT work: kitty writes
|
|
# the whole chord in one pty write and tmux drops the buffered bytes when the
|
|
# prompt opens. Run the tmux client command out-of-band instead; with no -c
|
|
# it targets the current client, i.e. this kitty window.
|
|
map ctrl+shift+g launch --type=background tmux display-popup -w 90% -h 90% -E -d "#{pane_current_path}" lazygit
|
|
map ctrl+shift+e launch --type=background tmux new-window -c "#{pane_current_path}" nvim
|
|
map ctrl+shift+p launch --type=background tmux split-window -v -l 25% -c "#{pane_current_path}" atuin-pick
|
|
|
|
# ── sessions ──
|
|
# a new kitty OS window runs kitty-tmux again == its own tmux session
|
|
map super+n new_os_window
|
|
map ctrl+shift+space new_os_window
|
|
map super+d send_text all \x02d
|
|
|
|
# BEGIN_KITTY_FONTS
|
|
font_family family="VictorMono Nerd Font Mono"
|
|
bold_font auto
|
|
italic_font auto
|
|
bold_italic_font auto
|
|
# END_KITTY_FONTS
|
|
# Colors + transparency from the active Omarchy theme (last include wins)
|
|
include ~/.local/state/omarchy/current/theme/kitty.conf
|