-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
executable file
·196 lines (144 loc) · 6.28 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
194
195
196
unbind %
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
#### Key bindings ####
# use vim key bindings
setw -g mode-keys vi
# use Ctrl+A instead of Ctrl+B
unbind C-b
set -g prefix C-a
bind C-a send-prefix
#bind-key m set-option -g mouse on \; display 'Mouse: ON'
# Mouse on
set-option -g -q mouse on
set-option -g escape-time 0
setw -g mode-keys vi
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# bind reload key
bind-key r source-file ~/.tmux.conf \; display-message "Config reloaded!"
# Set scroll speed to one line
set -g @scroll-speed-num-lines-per-scroll 1
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# increase repeat time for repeatable commands
set -g repeat-time 1000
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# 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
# disable aggressive resize for iTerm integration
setw -g aggressive-resize off
###########################
# Status Bar
###########################
# set refresh interval for status bar
set -g status-interval 30
# justify the status bar
set -g status-justify left
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-right-length 100
set -g status-left '#[fg=green]#S#[fg=blue] #I:#P #[default]'
###########################
# Colors
###########################
# set-option -g status-style 'bg=white, fg=blue'
# set-option -g status-attr default
# # Gruvbox Dark
# set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
# set-window-option -g window-status-style 'bg=default'
# set-window-option -g window-status-current-style 'bg=yellow, fg=black'
# set-window-option -g window-status-activity-style 'bg=green, fg=black'
# set -g message-style 'bg=green, fg=black' #base02
# set -wg mode-style bg=yellow,fg=black
# Gruvbox Light
# set-option -g status-style bg=colour223,fg=colour242 # bg=bg1, fg=fg1
# set-window-option -g window-status-style 'bg=default'
# set-window-option -g window-status-current-style 'bg=blue, fg=black'
# set-window-option -g window-status-activity-style 'bg=green, fg=black'
# set -g message-style 'bg=green, fg=black' #base02
# set -wg mode-style bg=yellow,fg=black
## Solarized
#set-window-option -g window-status-style 'bg=default'
## show date, time, and battery in right status bar
set-option -g status-right '#[fg=blue]#(whoami)@pineapple3 #[fg=green]#(/Users/$(whoami)/dev/dotfiles/battery.sh)#[fg=blue] %a %d/%m/%Y %I:%M%p\
#[fg=red]#(battery discharging)#[default]#(battery charging)'
## set-option -g status-style 'bg=colour15, fg=blue'
## Solarized Light
set-option -g status-style 'bg=white, fg=blue'
set -g message-style 'bg=green, fg=white' #base02
set -wg mode-style bg=green,fg=white
set-window-option -g window-status-current-style 'bg=default, fg=green'
set-window-option -g window-status-activity-style 'bg=green, fg=white'
# ## Solarized Dark
# set-option -g status-style 'bg=black, fg=blue'
# set -g message-style 'bg=black, fg=green' #base02
# set -wg mode-style bg=green,fg=black
# set-window-option -g window-status-current-style 'fg=yellow'
# set-window-option -g window-status-activity-style 'bg=green, fg=white'
# AppSignal Light
# set-window-option -g window-status-style 'bg=default'
# set-option -g status-style 'bg='colour15', fg=blue'
# set -g message-style 'bg=green, fg=black' #base02
# set -wg mode-style bg=green,fg=black
# set-window-option -g window-status-current-style 'bg=green, fg=black'
# set-window-option -g window-status-activity-style 'bg=yellow, fg=black'
## Solarized Dark
# set-option -g status-style 'bg=black, fg=blue'
# set -g message-style 'bg=black, fg=green' #base02
# set -wg mode-style bg=green,fg=black
# set-window-option -g window-status-current-style 'fg=yellow'
# set-window-option -g window-status-activity-style 'bg=green, fg=white'
# One Dark
#set-window-option -g window-status-current-style 'bg=default, fg=magenta'
#set-window-option -g window-status-activity-style 'bg=green, fg=black'
#set-option -g status-style 'bg=black, fg=green'
#set -g message-style 'bg=green, fg=black' #base02
#set-option -g status-right '#(whoami)@pineapple3 #[fg=blue]#(/Users/$(whoami)/dev/dotfiles/battery.sh)#[default] %a %d/%m/%y %I:%M%p\
##[fg=red]#(battery discharging)#[default]#(battery charging)'
# Pane border
# set -g pane-border-fg black #base02
#set -g pane-active-border-fg brightgreen #base01
# Message text
## Gruvbox
# set -g message-style 'bg=black, fg=white'
# Pane number display
set -g display-panes-active-colour blue #blue
set -g display-panes-colour brightred #orange
# Use vim-like navigation
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) || \
tmux select-pane -L"
bind -n C-j run "($is_vim && tmux send-keys C-j) || \
($is_fzf && tmux send-keys C-j) || \
tmux select-pane -D"
bind -n C-k run "($is_vim && tmux send-keys C-k) || \
($is_fzf && tmux send-keys C-k) || \
tmux select-pane -U"
bind -n C-l run "($is_vim && tmux send-keys C-l) || \
tmux select-pane -R"
bind-key -n C-w if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind f resize-pane -Z
bind a choose-tree -s
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'