-
Notifications
You must be signed in to change notification settings - Fork 107
/
dot.tmux.conf
180 lines (136 loc) · 4.74 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
##
## Basic Options
##
# Mouse
set -g mouse on
# Enable status bar
bind-key b set status
##
## Copy mode
##
unbind [
bind Escape copy-mode
setw -g mode-keys vi
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
##
## Key bindings
##
# Panel splites and selection
bind-key -n C-\ last-window
bind-key -n C-b previous-window
bind-key -n C-n next-window
bind n next-window
bind b previous-window
# Kill
bind q kill-window
bind Q kill-session
##
## Appearance
##
# Status bar
set -g status-position bottom
set -g status-interval 4
set -g status-left ''
set -g status-right ''
set -g status-justify left # center align window list
setw -g status-bg default
setw -g window-status-current-style fg=default,bg=default
setw -g window-status-style fg=white,fg=default
setw -g window-status-format '#[bg=black]#[fg=black,bold] #I #[bg=default] #[fg=black]#W '
setw -g window-status-current-format '#[fg=white]#[bg=cyan] #I #[fg=white]#[bg=default] #W '
# Panel borders
set -g pane-active-border-style fg=cyan,bg=default
set -g pane-border-style fg=black,bg=default
# Message text
set-option -g message-style fg=default,bg=default
#-------------------------------------------------------#
#PANE NAVIGATION/MANAGEMENT
#-------------------------------------------------------#
# splitting panes
bind \ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# open new panes in current path
bind c new-window -c '#{pane_current_path}'
# Use Alt-arrow keys WITHOUT PREFIX KEY to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
#
#https://stackoverflow.com/questions/42484934/set-default-color-theme-in-vim-under-tmux-cygwin-the-same-as-outside-tmux
#Start windows at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
#setw -g mode-mouse on
setw -g monitor-activity on
# move to last active window
bind-key Tab last-window
bind-key v split-window -h
bind-key s split-window -v
bind-key -r Down resize-pane -D 2
bind-key -r Up resize-pane -U 2
bind-key -r Left resize-pane -L 2
bind-key -r Right resize-pane -R 2
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
set -g status-interval 1 # redraw status line every second
# No delay for escape key press
set -sg escape-time 0
set-option -g repeat-time 500
# edit configuration
bind-key e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-nvim} ~/.tmux.conf'"
# reload configuration
bind-key r source-file ~/.tmux.conf \; display '~/.tmux.conf reloaded'
# Update the TERM variable when creating or attaching to a session
set -g update-environment \
'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
set-option -g default-terminal "tmux-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc" # true color support
#bind-key Enter run-shell 'tmux choose-tree -Nwf"##{==:##{session_name},#{session_name}}"'
bind-key m set-option -g mouse on \; display 'Mouse: ON'
bind-key M set-option -g mouse off \; display 'Mouse: OFF'
# Plugin list
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-mem'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'odedlaz/tmux-status-variables'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @scroll-down-exit-copy-mode "off"
set -g @yank_selection 'clipboard'
set -g @cpu_low_icon '▁'
set -g @cpu_medium_icon '▃'
set -g @cpu_high_icon '▇'
# Don't show a message on a bell
set -g visual-bell off
# Don't actually ring the bell (but still set the window attributes in
# the status bar so we know that a bell rang)
set -g bell-action none
set -g monitor-activity on
# auto window rename
set-option -g renumber-windows on
set -g status-right '#{cpu_fg_color}#{cpu_percentage} #{cpu_icon}'
#set -g status-left ' [#S] '
set -g status-left ''
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'