-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
193 lines (158 loc) · 6.45 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
181
182
183
184
185
186
187
188
189
190
191
192
193
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 @continuum-restore 'on'
run -b '~/.tmux/plugins/tpm/tpm'
# INFO: press "<prefix> I" to intall the plugins on a new system
# ## keybindings
# unbind C-b
# unbind C-a
# unbind %
# unbind ,
# unbind .
# unbind n
# unbind p
# unbind [
# unbind '"'
# unbind l
# unbind &
# unbind "'"
#
set-option -g prefix C-a #
# set-option -g default-command "reattach-to-user-namespace -l zsh" # Fix Mac clipboard
set -sg escape-time 0 # Vim fixage
# set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color" # things like less or vi on servers freak out
set -ga terminal-overrides ",*256col*:Tc"
#
# bind-key Y run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy"
#
# bind-key j select-pane -D
# bind-key k select-pane -U
# bind-key h select-pane -L
# bind-key l select-pane -R
#
# bind-key C-a last-pane
# bind-key | split-window -h
# bind-key \ split-window -h
# bind-key - split-window -v
# bind-key x kill-pane
# bind-key X kill-window
# bind-key q confirm-before kill-session
# bind-key Q confirm-before kill-server
# bind-key , previous-window # <
# bind-key . next-window # >
# bind-key < swap-window -t :-
# bind-key > swap-window -t :+
# bind-key n command-prompt 'rename-window %%'
# bind-key N command-prompt 'rename-session %%'
# bind-key Escape copy-mode -u
# bind-key R refresh-client
# bind-key C-h resize-pane -L 5
# bind-key C-l resize-pane -R 5
# bind-key C-j resize-pane -D 5
# bind-key C-k resize-pane -U 5
#
bind-key -n M-s set status
## set status bar
# set-option -g status-position top
# set-option -g status-utf8 on
## dark
bgcolour=colour235
bgcolour_deco=colour236
bgcolour_high=colour241
bgcolour_high2=colour255
fgcolour=colour239
fgcolour_high=colour245
fgcolour_high2=colour250
## light
# bgcolour=colour254
# bgcolour_deco=colour250
# bgcolour_high=colour241
# bgcolour_high2=colour235
# fgcolour=colour235
# fgcolour_high=colour233
# fgcolour_high2=colour232
set-option -g status-bg $bgcolour
set-option -g status-fg $fgcolour
set-option -g status-left '#[bg=$bgcolour_high]#[fg=$fgcolour_high]#[fg=$fgcolour_high2] #S #[default]#[fg=$fgcolour_high]'
set-option -g status-right '#[default]#[fg=$bgcolour_high]#[bg=$bgcolour_high] #[fg=$fgcolour_high2,nobold]#(date +"%H:%M") #[fg=$bgcolour_high2]#[bg=$bgcolour_high2]#[fg=$bgcolour] #(date +"%b %d") '
set-option -g status-right-length 150
set-option -g status-left-length 60
set-option -g status-justify left
set-option -g message-style "bg=$bgcolour fg=$fgcolour_high2"
## set window notifications
set-option -g visual-activity on
# set-option -g visual-content on
#set-window-option -g monitor-activity on
set-window-option -g automatic-rename off
# Enable focus events so that vim can detect focus
set -g focus-events on
## tmux window titling for X
set-option -g set-titles on
set-option -g set-titles-string '[#I] #W'
set-window-option -g automatic-rename on
set-window-option -g window-status-format ' #I #W '
## highlight active window
set-window-option -g window-status-current-format ' #I #W '
set-window-option -g window-status-current-style "bg=$bgcolour fg=$fgcolour_high,bold"
# starts windows at 1 not 0
set-option -g base-index 1
# ## enable mouse
# set-option -g mouse-select-pane on
set-window-option -g mode-keys vi
# set-window-option -g mode-mouse on
set -g mouse on
set-option -g history-limit 90000
bind -n C-k clear-history
## pane border and colors
set-option -g pane-border-style "fg=$bgcolour_deco"
set-option -g pane-active-border-style "bg=default fg=$bgcolour_deco"
set-option -g default-shell /usr/bin/fish
set -g set-clipboard off
bind-key -T copy-mode-vi M-y send -X copy-pipe "wl-copy" \; display-message "copied to system clipboard"
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "wl-copy" \; display-message "copied to system clipboard"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "wl-copy" \; display-message "copied to system clipboard"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "wl-copy" \; display-message "copied to system clipboard"
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; send-keys -X copy-pipe-no-clear "wl-copy" \; display-message "copied to system clipboard"
bind-key -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-word \; send-keys -X copy-pipe-no-clear "wl-copy" \; display-message "copied to system clipboard"
bind-key -n M-1 select-window -t :=1
bind-key -n M-2 select-window -t :=2
bind-key -n M-3 select-window -t :=3
bind-key -n M-4 select-window -t :=4
bind-key -n M-5 select-window -t :=5
bind-key -n M-6 select-window -t :=6
bind-key -n M-7 select-window -t :=7
bind-key -n M-8 select-window -t :=8
bind-key -n M-9 select-window -t :=9
bind-key -n M-0 select-window -t :=10
#bind-key -n M-Up select-pane -U
#bind-key -n M-Down select-pane -D
#bind-key -n M-Left select-pane -L
#bind-key -n M-Right select-pane -R
bind-key -n M-z resize-pane -Z
bind-key -n M-w choose-tree -Zw
# 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 M-Left if-shell "$is_vim" "send-keys M-Left" "select-pane -L"
bind-key -n M-Down if-shell "$is_vim" "send-keys M-Down" "select-pane -D"
bind-key -n M-Up if-shell "$is_vim" "send-keys M-Up" "select-pane -U"
bind-key -n M-Right if-shell "$is_vim" "send-keys M-Right" "select-pane -R"
bind-key -n M-\\ if-shell "$is_vim" "send-keys M-\\" "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 r source ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind % split-window -h -c "#{pane_current_path}"
bind \" split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# run -b '~/.tmux/plugins/tmux-resurrect/scripts/restore.sh r'
bind-key a send-prefix
set-option -g update-environment "DISPLAY WAYLAND_DISPLAY I3SOCK SWAYSOCK SSH_AUTH_SOCK"
set-option -sa terminal-features ',xterm-kitty:RGB'
set -g @resurrect-processes 'false'