-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
180 lines (149 loc) · 6.14 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
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
unbind C-b
unbind C-o
set -g prefix C-a
bind C-a send-prefix
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ setup ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
set -g mouse on
set -g base-index 1
set -g pane-base-index 1
set -g allow-rename on
set -g renumber-windows on
set -sg escape-time 0
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -g bell-action none
set -g remain-on-exit off
set -g default-shell "/opt/homebrew/bin/nu"
setw -g mode-keys vi
setw -g monitor-activity off
setw -g mode-keys vi
setw -g aggressive-resize on
set -g default-terminal "tmux-256color" # https://gist.github.com/bbqtd/a4ac060d6f6b9ea6fe3aabe735aa9d95
set -ga terminal-overrides ',*:RGB'
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ colors ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
tmux_var_dark_theme=1
fg1="#{?tmux_var_dark_theme,#a3b8ef,#aaaaaa}"
fg2="#{?tmux_var_dark_theme,#c2a2e3,#444444}"
# sep="•"
sep="◦"
s1="#[fg=${fg1}]"
s2="#[fg=${fg2}]"
date="%Y-%m-%d"
time="%H:%M"
tmux_var_process="#{pane_current_command}"
tmux_var_path="#(nu ~/dotfiles/tmux/path.nu #{pane_pid})"
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ status line ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
set -g status-left ""
set -g status-right "${s1}${tmux_var_process} ${sep} ${date} ${time}"
set -g window-status-format "${sep} ${s1}${tmux_var_path} "
set -g window-status-current-format "${s1}${sep} ${s2}${tmux_var_path} "
set -g window-status-separator ""
set -g mode-style "fg=${fg1},bg=default"
set -g message-style "fg=${fg1},bg=default"
set -g message-command-style "fg=${fg1},bg=default"
set -g pane-border-style fg=#99aee5
set -g popup-border-style fg=#31748f
set -g pane-active-border-style fg=#99aee5
set -g status-interval 1
set -g status-position top
set -g status-bg default
set -g status-style default
set -g status-justify left
set -g status-left-length 100
set -g status-right-length 200
set -g popup-border-lines "rounded"
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ bindings ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
bind r source-file ~/.tmux.conf \; display ".tmux.conf reloaded"
bind -r h resize-pane -L 4
bind -r j resize-pane -D 2
bind -r k resize-pane -U 2
bind -r l resize-pane -R 4
bind / copy-mode \; send-key ?
bind [ select-layout tiled
bind C-u copy-mode
bind -n M-v copy-mode
bind C-z copy-mode
bind D detach
bind x kill-window -a
bind q kill-pane
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ popups ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
bind o popup -d "#{pane_current_path}" -E "nu -l -c 'run-nu-script ~/notes/work/open_links.nu'"
bind i popup -h 40 -w 160 -E "nu -l -c 'notes'"
bind p run-shell -b "nu -l ~/dotfiles/scripts/capture-pane.nu #{pane_index}"
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ splits ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
bind -n M-m splitw -b -h -l 27% -c "#{pane_current_path}"
# 4 panes
bind C-l splitw -l 50% -c "#{pane_current_path}" -h \;\
select-pane -t 1 \;\
splitw -l 50% -c "#{pane_current_path}" \;\
select-pane -t 1 \;\
splitw -l 50% -c "#{pane_current_path}" -h \;\
select-pane -t 1 \;\
select-layout tiled
# # 6 panes
# bind C-k splitw -l 50% -c "#{pane_current_path}" -h \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" -h \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" -h \;\
# select-pane -t 1 \;\
# select-layout tiled
#
# bind C-j splitw -p 32 -c "#{pane_current_path}" -b -h \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 3 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 5 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 1 \;\
# select-pane -t 5
#
# bind C-i splitw -p 32 -c "#{pane_current_path}" -b -h \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 2 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 1 \;\
# splitw -l 50% -c "#{pane_current_path}" \;\
# select-pane -t 1 \;\
# select-pane -t 5
bind -n M-n previous-window
bind -n M-p next-window
bind -n M-z resize-pane -Z
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-i new-window -c "#{pane_current_path}" -n 1
bind -n M-o splitw -h -c "#{pane_current_path}"
bind -n "M-'" splitw -v -c "#{pane_current_path}"
bind -n M-X kill-window
bind -n M-q kill-pane
# bind -n M-q run-shell ~/dotfiles/scripts/tmux_close.sh
bind -n -r M-s swap-pane -D
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
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ plugins ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-sessionist'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @continuum-boot 'on'
set -g @continuum-restore 'on'
set -g @continuum-save-interval '1' # minutes
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'off'
set -g @yank_action 'copy-pipe'
run '~/.tmux/plugins/tpm/tpm'