-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.tmux.conf
More file actions
209 lines (168 loc) · 6.76 KB
/
.tmux.conf
File metadata and controls
209 lines (168 loc) · 6.76 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# set ctrl space as command
unbind C-b
set-option -g prefix C-Space
bind-key C-Space send-prefix
# if-shell "test -f ~/.tmux/tmuxline_theme.sh" "source ~/.tmux/tmuxline_theme.sh"
set -g @plugin 'dracula/tmux'
set -g @dracula-border-contrast true
set -g @dracula-show-powerline true
set -g @dracula-show-empty-plugins false
set -g @dracula-show-edge-icons true
set -g @dracula-show-left-icon "#S #{pane_id}"
set -g @dracula-show-ssh-only-when-connected true
set -g @dracula-plugins "cpu-usage ram-usage ssh-session"
set -g @plugin 'kristopolous/tmux-gentrify'
# - `<prefix> Alt-x`: Cut a pane (marks it and breaks it off)
# - `<prefix> Alt-v`: Paste the cut pane into the current window
# some stuff
set -g default-terminal "tmux-256color"
# set -g default-terminal 'screen-256color'
set -g history-limit 100000
set-option -g set-titles on
set-option -g set-titles-string "tmux:#S #W #T"
# set-option -g default-shell /bin/bash
set -g extended-keys on
set-option -g default-shell /bin/zsh
set-option -g detach-on-destroy off
setw -g aggressive-resize on
# enable clicking
set -g mouse on
set -s escape-time 0
# split panes using | and -
bind c new-window -c "#{pane_current_path}"
bind ü split-window -h -c "#{pane_current_path}"
bind ö split-window -v -c "#{pane_current_path}"
bind > split-window -h -c "#{pane_current_path}"
bind < split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
bind Escape copy-mode
bind p paste-buffer
bind -n M-ú paste-buffer
bind ő copy-mode # map [ to the place it would be on English keyboards
bind -n M-ő copy-mode
bind -T copy-mode-vi v send -X begin-selection
bind ú paste-buffer ## map ] to the place it would be on English keyboards
setw -g mode-keys vi
###########################
# Plugins
###########################
# To install plugins:
# 1) Add plugin down here
# 2) Prefix + I to install plugin
# To update plugins:
# 1) Prefix + U
# To remove plugins:
# 1) Remove line down here
# 2) Prefix + ALT + U
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes 'vim nvim man less htop claude ~confed ~ipython'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-save-interval '1'
set -g @continuum-restore 'on'
# set -g @continuum-boot 'on'
set -g @resurrect-restore 'R'
set -g @resurrect-save 'S'
bind-key r run-shell "tmux source-file $HOME/.tmux.conf > /dev/null; tmux display-message 'Sourced tmux config!'"
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'ofirgall/tmux-window-name'
set -g @tmux_window_name_icon_style "'name_and_icon'"
set -g @plugin 'alberti42/tmux-fzf-links'
set-option -g @fzf-links-fzf-display-options "-w 80% --maxnum-displayed 20 --multi --track"
if-shell 'OSTYPE=$(uname -s) && case $OSTYPE in "Linux") true; ;; *) false; ;; esac' {
# Linux
set-option -g @fzf-links-browser-open-cmd "xdg-open '%url'"
}{
if-shell 'OSTYPE=$(uname -s) && case $OSTYPE in "Darwin") true; ;; *) false; ;; esac' {
# Darwin
set-option -g @fzf-links-browser-open-cmd "open '%url'"
}
}
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'sainnhe/tmux-fzf'
TMUX_FZF_OPTIONS="-p -w 80% -h 50% "
bind "C-s" run-shell "$HOME/.tmux/plugins/tmux-fzf/scripts/session.sh switch"
bind -n "M-s" run-shell "$HOME/.tmux/plugins/tmux-fzf/scripts/session.sh switch"
bind "C-w" run-shell "$HOME/.tmux/plugins/tmux-fzf/scripts/window.sh switch"
bind -n "M-w" run-shell "$HOME/.tmux/plugins/tmux-fzf/scripts/window.sh switch"
bind "C-p" run-shell "$HOME/.tmux/plugins/tmux-fzf/scripts/pane.sh switch"
bind -n "M-p" run-shell "$HOME/.tmux/plugins/tmux-fzf/scripts/pane.sh switch"
bind "w" choose-tree -Z
bind "c-n" command-prompt -I "new -s "
bind "z" resize-pane -Z
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-0 select-window -t 0
bind 1 select-window -t 1
bind 2 select-window -t 2
bind 3 select-window -t 3
bind 4 select-window -t 4
bind 5 select-window -t 5
bind 6 select-window -t 6
bind 7 select-window -t 7
bind 8 select-window -t 8
bind 9 select-window -t 9
bind 0 select-window -t 0
# HU layout symbols mode (kanata vk_num off): unshifted number row outputs HU symbols
bind "'" select-window -t 1
bind '"' select-window -t 2
bind + select-window -t 3
bind ! select-window -t 4
bind % select-window -t 5
bind / select-window -t 6
bind = select-window -t 7
bind ( select-window -t 8
bind ) select-window -t 9
bind § select-window -t 0
# Track last pane across sessions
set-hook -g pane-focus-out 'run "tmux set -g @last_pane_id #{pane_id}"'
bind "," run-shell 'tmux switch-client -t$(tmux show -gqv @last_pane_id)'
bind -n M-, run-shell 'tmux switch-client -t$(tmux show -gqv @last_pane_id)'
bind -n M-h resize-pane -L 5
bind -n M-j resize-pane -D 5
bind -n M-k resize-pane -U 5
bind -n M-l resize-pane -R 5
bind -n M-t run-shell 'tmuxscratch'
bind t run-shell 'tmuxscratch'
set -g @plugin 'jaclu/tmux-power-zoom'
set -g @power_zoom_without_prefix '1'
set -g @power_zoom_trigger 'M-z'
# set -g @plugin 'graemedavidson/tmux-pane-focus'
# set -g @pane-focus-size on
# set -g @pane-focus-size '50'
# set -g @pane-focus-direction '+'
set -g focus-events on
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
# 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'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"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 -T copy-mode-vi 'C-é' select-pane -l