-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
83 lines (71 loc) · 2.74 KB
/
Copy path.tmux.conf
File metadata and controls
83 lines (71 loc) · 2.74 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# --- Terminal capabilities ---
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",*256col*:Tc"
# Undercurl + colored undercurl (LSP diagnostics in nvim)
set -ag terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -ag terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p2%{256}%/%{255}%&%d::%p3%{255}%&%dm'
# --- Core behavior ---
set -g base-index 1
setw -g pane-base-index 1
set -g detach-on-destroy off
set -g renumber-windows on
set -g set-clipboard on
set -g focus-events on
set -g allow-passthrough on
set -g status-position bottom
# --- Prefix ---
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# --- Reload ---
bind r source-file ~/.tmux.conf \; display "tmux.conf reloaded"
# --- Splits & windows preserve cwd ---
unbind '"'
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# --- Repeatable pane resize ---
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# --- Seamless tmux <-> nvim navigation (Alt-hjkl, no harpoon conflict) ---
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
bind -T copy-mode-vi M-h select-pane -L
bind -T copy-mode-vi M-j select-pane -D
bind -T copy-mode-vi M-k select-pane -U
bind -T copy-mode-vi M-l select-pane -R
# --- Vi copy mode (xclip locally; set-clipboard/OSC 52 covers SSH) ---
set -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -selection clipboard -in"
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi V send -X select-line
bind -T copy-mode-vi C-v send -X rectangle-toggle
# --- Plugins ---
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'xamut/tmux-weather'
# tmux-fzf launcher
TMUX_FZF_LAUNCH_KEY="F"
# Continuum
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
# Catppuccin
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "rounded"
set -g status-left ""
set -g status-right "#{E:@catppuccin_status_session}"
set -agF status-right "#{E:@catppuccin_status_directory}"
set -agF status-right "#{E:@catppuccin_status_application}"
set -agF status-right "#{E:@catppuccin_status_weather}"
run '~/.tmux/plugins/tpm/tpm'