-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
219 lines (175 loc) · 6.11 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# // TMUX
#// enable <leader> r to reload tmuk
unbind r
bind r source-file ~/.tmux.conf
# --- --- ---
# // change <leader> / <prefix> key to backtick only for MAC
if-shell "uname | grep -q Darwin" "\
unbind C-b; \
set-option -g prefix `; \
bind ` send-prefix"
#:endif
# // open tmux command line
# <leader> :
# // RELOAD TMUX
# :source ~/.tmux.conf
# // turn on ability to mouse scroll
# // note: only works in terminal and not vim/neovim
# // if off then can scroll in vim/neovim but not terminal
#set -g mouse on
# // alternative: to scroll in terminal only when needed
# // enters tmux scroll mode
# // enter COPY MODE
# <leader> [
# // to exit just press 'q' or 'esc' or ctrl+c if that doesn't work
# // to use vim search commands when in tmux scroll mode
set-window-option -g mode-keys vi
# // STATUS BAR
# // set status bar background color
#set -g status-bg colour53 # deep pink4
set -g status-bg colour234 # grey11
#set -g status-bg colour234 # grey11
#set -g status-bg colour235 # grey15
# // set status bar foreground color
#set -g status-fg colour255 # grey93
set -g status-fg colour244 # grey50
set -g status-left '#{session_name}_';
#// #W = window name
#// #F = window flags
set -g window-status-format '#W#F';
set -g window-status-current-format '#[fg=colour255]#W#F';
set -g status-right-length 100
#set -g status-right "[#(battery Discharge)] %Y-%m%b-%d%a %T %Z"
#set -g status-right "#H #{pomodoro_status}%Y-%m%b%d%a #[fg=colour255]%T#[fg=colour244]%Z"
#set -g status-right "#H #{pomodoro_status}%Y-%m%dw%W%a #[fg=colour255]%T#[fg=colour244]%Z"
set -g status-right "#H #{pomodoro_status}%Y-%m%dw%W%a #[fg=colour255]%H%M:%S#[fg=colour244]%Z"
# // note: #H / hostname is weird if you don't have your VPN on
# // note: strftime python used for datetime codes
# for remote linux simplify the status bar
if-shell "uname | grep -q Linux" "\
set -g status-left '#{session_name}_'; \
set -g window-status-format '#W#F'; \
set -g window-status-separator ' '; \
set -g status-right '%Y%m%d#[fg=colour255]%H%M#[fg=colour244]%Z'; \
set -g window-status-current-format '#[fg=colour255]#W#F'; "
#set -g window-status-current-format '#[fg=colour255]#I:#W#F'; "
# // open time
# <leader> t
# // to exit just press enter
# // SESSION
# // to create a NEW SESSION
# $ tmux (new -s <session-name>)
# // to RENAME a (target) SESSION
# $ tmux rename-session -t <old-session-name> <new-session-name>
# // note: you can do this within the session or outside of it
# // to KILL a (target) SESSION
# $ tmux kill-session -t <session-name>
# // to LIST all SESSIONS
# $ tmux ls
# // to DETACH from a SESSION
# <leader> d
# // to ATTACH to a (target) SESSION
# $ tmux attach -t <session-name|ex:n=0-99>
# // WINDOW
# // settings
set -g base-index 1 #// windows not start at zero index
set -g renumber-windows on #// windows 1,2(x),3 -> 1,2 not 1,3
set -g window-style 'bg=colour234,fg=colour247' #// inactive style
# colour 234 = grey11
# colour 247 = grey62
set -g window-active-style 'bg=colour232,fg=colour244' #// active style
# color 232 = grey3
# color 244 = grey50
# // create a new window
# <leader> c
# // rename the current window
# <leader> ,
# OR
# :rename-window <new-name>
# // to go to a WINDOW use the window key '#'
# <leader> <window #>
# // to go to Next WINDOW (to the window after this one)
# <leader> n
# // to go to Previous WINDOW (to the window before this one)
# <leader> p
# // to go to Last WINDOW (to flip between current and last active window)
# <leader> l
# // to exit a WINDOW just type exit and press enter
# $ exit
# // to swap / switch WINDOWS
# :swap-window -s <src-window-index> -t <target-window-index>
# // PANE
# // settings
set -g pane-base-index 1
set -g pane-border-style 'bg=colour234,fg=colour238' # grey 27 font
set -g pane-active-border-style 'bg=colour234,fg=colour5' # purple font
# // create a new Vertical PANE
# <leader> %
# // create a new Horizontal PANE
# <leader> "
# // Check all tmux key bindings
# <leader> ?
# // Navigate between PANE
# <leader> <left-arrow>|<up-arrow>|<down-arrow>|<right-arrow>
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# // toggle between pane layouts like quadrants
# <leader> <space>
# // RESIZE a PANE Up/Down/Left/Right
# :resize-pane -(U/D/L/R) (# of cells)
# // show / flash pane numbers
# <leader> q
# // just press the index to go to that pane after it is flashed
# // ZOOM in & out of a PANE (fullscreen)
# <leader> z
# // to EXIT a PANE just type exit and press enter
# $ exit
# // alternatively:
# <leader> x
# --- --- ---
# TMUX PLUGIN MANAGER
# see: https://github.com/tmux-plugins/tpm
# []- clone repo: Tmux Plugin Manager (tpm)
# $ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# // should create the ~/.tmux/ directory and allow for plugin installs
# Enable mouse interactions on tmux
set-option -g mouse on
# Resize pane to the left
bind-key -n C-h resize-pane -L 5
# Resize pane to the downward
bind-key -n C-j resize-pane -D 5
# Resize pane to the upward
bind-key -n C-k resize-pane -U 5
# Resize pane to the right
bind-key -n C-l resize-pane -R 5
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' # basic tmux settings
set -g @plugin 'tmux-plugins/tmux-resurrect' # to save sessions accross system restarts
# <leader> ctrl+s // to save
# <leader> ctrl+r // to restore
# // ex:
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin '[email protected]:user/plugin'
set -g @plugin 'olimorris/tmux-pomodoro-plus'
set -g @pomodoro_start 'b' # key binding to start <leader> + b
set -g @pomodoro_cancel 'B'
set -g @pomodoro_cancel 'B'
set -g @pomodoro_mins 25 # FOCUS
set -g @pomodoro_break_mins 5 # BREAK
set -g @pomodoro_on "#[fg=$text_green]♻️ "
set -g @pomodoro_complete "#[fg=$text_red]☑️ "
set -g @pomodoro_notifications 'on'
set -g @pomodoro_sound 'Pop'
# RELOAD tmux environment with plugins
#$ tmux source ~/.tmux.conf
# <leader> :source ~/.tmux.conf
# INSTALL plugins
# <leader> I
# UPDATE plugins
# <leader> U
# UNINSTALL plugins
# <leader> alt u
# // INITIALIZE TMUX plugin manager (keep at bottom of .tmux.conf)
run '~/.tmux/plugins/tpm/tpm'