-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
131 lines (101 loc) · 4.1 KB
/
tmux.conf
File metadata and controls
131 lines (101 loc) · 4.1 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
set -g prefix C-a
unbind C-b
# move statusbar to the top
set-option -g status-position top
set-option -g display-time 4000
# quick session cycling
unbind ^A
bind ^A switch-client -l
bind s choose-tree -s -O name
set -g history-limit 100000
set -g bell-action none
set -g visual-bell off
# Evenly size panes horizontally
bind = select-layout even-vertical
bind-key -n "C-M-j" resize-pane -D 5
bind-key -n "C-M-k" resize-pane -U 5
bind-key -n "C-M-h" resize-pane -L 5
bind-key -n "C-M-l" resize-pane -R 5
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
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"
bind-key -n "C-\\" if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
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
bind-key -T copy-mode-vi "C-\\" select-pane -l
bind-key -n C-z resize-pane -Z
bind-key z send-keys C-z
set-window-option -g mode-keys vi
# Open new windows and splits in current path
bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key "\"" split-window -l 20% -c "#{pane_current_path}"
bind-key b send-prefix
# Start numbering at 1
set -g base-index 1
set -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# Allows for faster key repetition
set -s escape-time 0
set -g mouse on
# Set terminal to tmux but kitty for RGB support
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-kitty:RGB"
# Underline and undercurl support
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy" \;\
send-keys -X clear-selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "pbcopy" \;\
send-keys -X clear-selection
bind-key -T copy-mode-vi escape send-keys -X cancel
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X cancel
bind C-p choose-buffer
# report focus events
set -g focus-events on
bind-key -T copy-mode-vi S send-keys -X copy-pipe "xargs -I {} tmux run-shell 'cd #{pane_current_path}; open https://google.com/search?q=\"{}\" > /dev/null'"
bind-key -n C-1 select-window -t 1
bind-key -n C-2 select-window -t 2
bind-key -n C-3 select-window -t 3
bind-key -n C-4 select-window -t 4
bind-key -n C-5 select-window -t 5
bind-key -n C-6 select-window -t 6
bind-key -n C-7 select-window -t 7
bind-key -n C-8 select-window -t 8
bind-key -n C-9 select-window -t 9
bind-key -n C-0 select-window -t 10
set -gq status on
set -gq status-justify left
set -gq status-left-length 100
set -gq status-right-length 100
set -gq status-right-attr none
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Continuum should always be the last plugin as it overrites the status line to save the session periodically
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @catppuccin_flavor "macchiato"
set -g @catppuccin_window_text "#W"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_window_status_style "rounded"
set -g status-left ""
set -g status-right "#{E:@catppuccin_status_session}"
set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
# set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-save-shell-history 'off'
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run 'tpack init'