summaryrefslogtreecommitdiff
path: root/tmux/tmux.conf
blob: 96b98b87619de37d5c73872fa0b3bdb78e9655b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
source ~/.config/tmux/tmux.local.conf

set-option -g allow-rename off
set-option -g history-limit 100000
set-option -s escape-time 0
set-option -g set-titles on

set-window-option -g mode-keys vi

bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R

bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5

bind-key g popup -E -w 99% -h 99% -d '#{pane_current_path}' "tmux-popup-new #{q:pane_current_path} -tmp-lazygit lazygit"
bind-key f popup -E -w 99% -h 99% -d '#{pane_current_path}' "tmux-popup-new #{q:pane_current_path} -tmp-ranger ranger"
bind-key e run-shell -b "cd #{q:pane_current_path} && hexai-tmux-edit --pane '#{pane_id}'"
bind-key N popup -E -w 99% -h 99% -d ~/Notes "tmux-popup-attach notes ~/Notes"
bind-key t popup -E -w 99% -h 99% -d '#{pane_current_path}' "tmux-popup-attach --basename #{q:pane_current_path} -tmp-scratch"
bind-key a popup -E -w 99% -h 99% -d '#{pane_current_path}' "tmux-popup-attach adhoc #{q:pane_current_path}"
bind-key H popup -E -w 99% -h 99% -d '#{pane_current_path}' "htop"
bind-key Q popup -E -w 99% -h 99% "tmux new-session -A -s quickedit quickedit"
bind-key V popup -E -w 99% -h 99% "tmux new-session -A -s quickview quickview"

# bind-key b break-pane -d
bind-key c new-window -c '#{pane_current_path}'
bind-key F new-window -n "session-switcher" "tmux list-sessions | fzf | cut -d: -f1 | xargs tmux switch-client -t"
bind-key p setw synchronize-panes off
bind-key P setw synchronize-panes on
bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "~/.config/tmux/tmux.conf reloaded"
bind-key T choose-tree

# Toggle "A-" prefix on the current session name (marks the session as an
# agent workload). Pressing it again strips the prefix.
bind-key @ run-shell 'cur=$(tmux display-message -p "#S"); case "$cur" in A-*) tmux rename-session "${cur#A-}" ;; *) tmux rename-session "A-$cur" ;; esac'

# Cycle through sessions whose name starts with "A-" (agent workloads).
# Mirrors the default Prefix+( / Prefix+) bindings but filtered to A- sessions.
bind-key O run-shell 'tmux-cycle-a-session next'
bind-key I run-shell 'tmux-cycle-a-session prev'

set-option -g pane-active-border-style fg=magenta,bold

set -g status-right '#{@hexai_status} #[fg=colour8]| %H:%M'
set -g status-right-length 120
set-environment -g HEXAI_TMUX_STATUS_THEME white-on-purple

# Enable the extended-keys feature so tmux can distinguish modified Enter
# keys (Shift+Enter, Ctrl+Enter, Alt+Enter) from plain Enter. Required by
# modern terminals that send distinct escape sequences for these.
set -g extended-keys on

# Use csi-u (Kitty) extended key encoding for unambiguous modifier+key combos.
# The default xterm format causes ambiguity with Ctrl/Alt/Shift combinations.