feat: kitty-compatible keybindings via tmux extended-keys (CSI u)
All Ctrl+Shift shortcuts mapped to match kitty defaults: - Ctrl+Shift+T/W/Left/Right for tab management - Ctrl+Shift+Enter for splits, ]/[ for pane cycling - Ctrl+Shift+C/V for copy/paste, H for scrollback pager - Ctrl+Shift+1-9 for goto tab, F11 for fullscreen - Dvorak extras and Alt shortcuts preserved alongside
This commit is contained in:
+90
-19
@@ -1,12 +1,91 @@
|
||||
# sethmux — Sethian tmux config for AI CLI workflows
|
||||
# Dvorak-optimized, mobile-friendly, built for long-running AI sessions
|
||||
# sethmux — kitty-compatible keybindings for tmux
|
||||
# Mirrors kitty's Ctrl+Shift+key shortcuts via extended-keys (CSI u)
|
||||
# Dvorak-optimized, mobile-friendly, built for AI CLI workflows
|
||||
|
||||
# --- Prefix ---
|
||||
# --- Extended keys (required for Ctrl+Shift detection) ---
|
||||
set -g extended-keys on
|
||||
set -g extended-keys-format csi-u
|
||||
|
||||
# --- No prefix for kitty-style bindings ---
|
||||
# Kitty uses Ctrl+Shift+key directly, no prefix needed.
|
||||
# We keep Ctrl-A as prefix for tmux-native stuff (capture, logging, etc.)
|
||||
unbind C-b
|
||||
set -g prefix C-a
|
||||
bind C-a send-prefix
|
||||
|
||||
# --- Tab/Window management ---
|
||||
# ============================================================
|
||||
# Kitty-compatible keybindings (Ctrl+Shift+key)
|
||||
# ============================================================
|
||||
|
||||
# --- Tab management ---
|
||||
bind -n C-S-t new-window -c "#{pane_current_path}"
|
||||
bind -n C-S-w kill-window
|
||||
bind -n C-S-Right next-window
|
||||
bind -n C-S-Left previous-window
|
||||
|
||||
# Ctrl+Shift+1-9 = goto tab (tmux base-index 1)
|
||||
bind -n C-S-1 select-window -t 1
|
||||
bind -n C-S-2 select-window -t 2
|
||||
bind -n C-S-3 select-window -t 3
|
||||
bind -n C-S-4 select-window -t 4
|
||||
bind -n C-S-5 select-window -t 5
|
||||
bind -n C-S-6 select-window -t 6
|
||||
bind -n C-S-7 select-window -t 7
|
||||
bind -n C-S-8 select-window -t 8
|
||||
bind -n C-S-9 select-window -t 9
|
||||
|
||||
# Ctrl+Shift+. / , = move tab forward/backward
|
||||
bind -n C-S-. swap-window -t +1 \; next-window
|
||||
bind -n C-S-, swap-window -t -1 \; previous-window
|
||||
|
||||
# --- Window/split management ---
|
||||
# Ctrl+Shift+Enter = new split (kitty calls these "windows")
|
||||
bind -n C-S-Enter split-window -v -c "#{pane_current_path}"
|
||||
|
||||
# Ctrl+Shift+] / [ = next/previous pane
|
||||
bind -n C-S-] select-pane -t :.+
|
||||
bind -n C-S-[ select-pane -t :.-
|
||||
|
||||
# Ctrl+Shift+l = next layout (cycle through layouts)
|
||||
bind -n C-S-l next-layout
|
||||
|
||||
# --- Scrolling ---
|
||||
bind -n C-S-Up copy-mode \; send -X scroll-up
|
||||
bind -n C-S-Down copy-mode \; send -X scroll-down
|
||||
bind -n C-S-PageUp copy-mode \; send -X page-up
|
||||
bind -n C-S-PageDown copy-mode \; send -X page-down
|
||||
bind -n C-S-Home copy-mode \; send -X history-top
|
||||
bind -n C-S-End copy-mode \; send -X history-bottom
|
||||
|
||||
# Ctrl+Shift+h = show scrollback in pager (like kitty's show_scrollback)
|
||||
bind -n C-S-h capture-pane -pS - \; save-buffer /tmp/sethmux-scrollback.txt \; new-window "less +G /tmp/sethmux-scrollback.txt"
|
||||
|
||||
# --- Clipboard ---
|
||||
# Ctrl+Shift+c = copy (enter copy mode, or copy selection if in copy mode)
|
||||
bind -n C-S-c copy-mode
|
||||
bind -T copy-mode-vi C-S-c send -X copy-selection-and-cancel
|
||||
|
||||
# Ctrl+Shift+v = paste from tmux buffer
|
||||
bind -n C-S-v paste-buffer
|
||||
|
||||
# --- Clear terminal ---
|
||||
# Ctrl+Shift+Delete = clear terminal + scrollback
|
||||
bind -n C-S-DC send-keys C-l \; clear-history
|
||||
|
||||
# --- Fullscreen ---
|
||||
# F11 = toggle pane zoom (closest to kitty's fullscreen)
|
||||
bind -n F11 resize-pane -Z
|
||||
|
||||
# ============================================================
|
||||
# Dvorak-friendly extras (prefix Ctrl-A)
|
||||
# ============================================================
|
||||
bind s split-window -v -c "#{pane_current_path}"
|
||||
bind v split-window -h -c "#{pane_current_path}"
|
||||
bind z resize-pane -Z
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind o select-pane -t :.+
|
||||
|
||||
# --- Alt shortcuts (no prefix, kept for mobile/quick access) ---
|
||||
bind -n M-t new-window -c "#{pane_current_path}"
|
||||
bind -n M-w kill-window
|
||||
bind -n M-1 select-window -t 1
|
||||
@@ -16,15 +95,10 @@ bind -n M-4 select-window -t 4
|
||||
bind -n M-5 select-window -t 5
|
||||
bind -n M-Left previous-window
|
||||
bind -n M-Right next-window
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
# --- Dvorak-friendly splits ---
|
||||
bind s split-window -v -c "#{pane_current_path}"
|
||||
bind v split-window -h -c "#{pane_current_path}"
|
||||
|
||||
# --- Pane navigation ---
|
||||
bind o select-pane -t :.+
|
||||
bind z resize-pane -Z
|
||||
# ============================================================
|
||||
# AI CLI workflow features
|
||||
# ============================================================
|
||||
|
||||
# --- Mouse ---
|
||||
set -g mouse on
|
||||
@@ -39,16 +113,15 @@ bind -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel
|
||||
|
||||
# --- Capture & logging ---
|
||||
# Ctrl-A S = save entire scrollback to file
|
||||
bind S capture-pane -pS - \; save-buffer ~/logs/capture-#{session_name}-#{window_index}-#{pane_index}-#(date +%s).txt \; display "Pane captured to ~/logs/"
|
||||
|
||||
# Ctrl-A L = toggle pipe-pane logging
|
||||
bind L pipe-pane -o "cat >> ~/logs/live-#{session_name}-#{window_index}-#(date +%s).log" \; display "Logging toggled"
|
||||
|
||||
# --- Clipboard ---
|
||||
set -g set-clipboard on
|
||||
# Copy on select (mouse)
|
||||
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "cat"
|
||||
|
||||
# ============================================================
|
||||
# Appearance
|
||||
# ============================================================
|
||||
|
||||
# --- Numbering ---
|
||||
set -g base-index 1
|
||||
@@ -75,8 +148,6 @@ setw -g window-status-separator ""
|
||||
# --- Pane borders ---
|
||||
set -g pane-border-style "fg=#333333"
|
||||
set -g pane-active-border-style "fg=#D35400"
|
||||
set -g pane-border-format " #{pane_current_command} "
|
||||
set -g pane-border-status off
|
||||
|
||||
# --- Terminal ---
|
||||
set -g default-terminal "tmux-256color"
|
||||
|
||||
Reference in New Issue
Block a user