-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
193 lines (155 loc) · 5.87 KB
/
dot_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 prefix C-Space
# use 256 xterm for pretty colors. This enables same colors from iTerm2 within tmux.
# This is recommended in neovim :healthcheck
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set-option -sa terminal-features ',alacritty:RGB'
set -s copy-command "xsel -i -b"
set -g mouse on
set -g base-index 1
set -g history-limit 100000
unbind r
bind r source-file ~/.tmux.conf \; display-message "Reloaded!"
# Make a smaller delay so we can perform commands after switching windows
set -sg escape-time 0
set -sg repeat-time 600
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# re-number windows when one is closed
set -g renumber-windows on
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*.
setw -g aggressive-resize on
# neovim integration
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
bind C-l send-keys 'C-l' # new clear screen
# panes
set-window-option -g pane-base-index 1
unbind %
bind v split-window -h -c "#{pane_current_path}"
unbind '"'
bind h split-window -v -c "#{pane_current_path}"
# windows
unbind n # DEFAULT KEY: next window
unbind w # DEFAULT KEY: change current window
bind w new-window -c "#{pane_current_path}"
bind n next-window
bind p previous-window
# copy mode
set-window-option -g mode-keys vi
unbind -T copy-mode-vi Space; # default for begin copy
unbind -T copy-mode-vi Enter; # default for copy selection
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel "xsel --clipboard"
bind C-S-c run 'tmux save-buffer - | xsel --clipboard'
bind C-S-v run 'tmux set-buffer "xsel -b"; tmux paste-buffer'
# enable pbcopy and pbpaste
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
# bind p paste-buffer
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# paste from system clipboard MacOS
# bind C-v run \"tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer"
############################
## Status Bar
############################
# enable UTF-8 support in status bar
set -gq status-utf8 on
# set refresh interval for status bar
set -g status-interval 30
# center the status bar
set -g status-justify centre
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-left '#[fg=green] #S #[fg=yellow]#I/#[fg=cyan]#P '
# show hostname, date, tim 100
set -g status-right '#(battery -t) #[fg=cyan] %d %b %R '
# update status bar info
set -g status-interval 60
##############
### DESIGN ###
##############
# panes
set -g pane-border-style fg=black
set -g pane-active-border-style fg=red
## Status bar design
# status line
set -g status-justify left
#set -g status-bg default
set -g status-style fg=blue
set -g status-interval 2
# messaging
set -g message-command-style fg=blue,bg=black
# window mode
setw -g mode-style bg=green,fg=black
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=white] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=white] #I #[fg=white]#[bg=cyan] #W "
setw -g window-status-current-style bg=black,fg=yellow,dim
setw -g window-status-style bg=green,fg=black,reverse
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set-window-option -g monitor-activity off
set -g bell-action none
# The modes
set-window-option -g clock-mode-colour red
set-window-option -g mode-style fg=red,bg=black,bold
# The panes
set -g pane-border-style bg=black,fg=black
set -g pane-active-border-style fg=blue,bg=black
# The statusbar
set -g status-position bottom
set -g status-style bg=black,fg=yellow,dim
set -g status-left ''
set -g status-right '#{?client_prefix,#[fg=white]#[bg=red]#[bold] - PREFIX - ,#[fg=brightwhite]#H}'
set -g status-right-length 50
set -g status-left-length 20
# The window
set-window-option -g window-status-current-style fg=red,bg=black,bold
set-window-option -g window-status-current-format ' #I#[fg=brightwhite]:#[fg=brightwhite]#W '
set-window-option -g window-status-style fg=magenta,bg=black,none
set-window-option -g window-status-format ' #I#[fg=brightblack]:#[fg=brightblack]#W#[fg=black]#F '
set-window-option -g window-status-bell-style fg=white,bg=red,bold
# The messages
set -g message-style fg=white,bg=red,bold
###############
### PLUGINS ###
###############
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'laktak/extrakto'
set -g @plugin 'junegunn/tmux-fzf-url'
# Add more plugins below this line
# Plugin to save and restore tmux sessions after restart
# * Save with: prefix + Ctrl-s
# * Restore with: prefix + Ctlr-r
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @vim_navigator_mapping_left "C-Left C-h" # use C-h and C-Left
set -g @vim_navigator_mapping_right "C-Right C-l"
set -g @vim_navigator_mapping_up "C-k"
set -g @vim_navigator_mapping_down "C-j"
set -g @vim_navigator_mapping_prev "" # removes the C-\ binding
# restore vim and nvim sessions as well
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
# I think continuous save and auto restore can
# be annoying, enable here if you want it
#set -g @plugin 'tmux-plugins/tmux-continuum'
# # Automatic restore
# set -g @continuum-restore 'on'
# Integration with Vim for panel navigation
set -g @plugin 'christoomey/vim-tmux-navigator'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# To install: PREFIX+SHIFT+i
run -b "$HOME/.tmux/plugins/tpm/tpm"