-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
80 lines (64 loc) · 2.67 KB
/
tmux.conf
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
# ========== Overwrites ==========
unbind r
set -g prefix C-s
# ========== Settings ==========
# Basic settings
set -g mouse on
set-option -g focus-events on
set-option -g status-position top
set -s escape-time 50
# Window/Pane settings
set -g base-index 1
setw -g pane-base-index 1
# Terminal settings
set-option -g focus-events on
set-option -sa terminal-features ',xterm-256color:RGB'
# Set vi mode
set-window-option -g mode-keys vi
# Copy settings based on OS
if-shell "uname | grep -q Darwin" {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'pbcopy'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'pbcopy'
} {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -selection clipboard -i'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -selection clipboard -i'
}
# Better copy mode bindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
# ========== Keybindings ==========
# Reload config
bind r source-file ~/.config/tmux/tmux.conf
# Smart pane switching with awareness of Vim splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
# Copy mode bindings
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
# ========== Plugins ==========
# Plugin manager
set -g @plugin 'tmux-plugins/tpm'
# Catppuccin theme
set -g @plugin 'catppuccin/tmux'
# settings for catppuccin tmux 2
# ref: https://github.com/catppuccin/tmux?tab=readme-ov-file#config-2
set -g @catppuccin_window_left_separator "█"
set -g @catppuccin_window_right_separator "█ "
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_middle_separator " █"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#{pane_current_path}"
set -g @catppuccin_status_modules_right "directory session date_time host"
set -g @catppuccin_status_left_separator ""
set -g @catppuccin_status_right_separator " "
set -g @catppuccin_status_fill "all"
set -g @catppuccin_status_connect_separator "yes"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'