-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
executable file
·193 lines (155 loc) · 6.48 KB
/
tmux.conf
File metadata and controls
executable file
·193 lines (155 loc) · 6.48 KB
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
# Use Ctrl+A as prefix
# unbind C-b
# set -g prefix C-a
set -g history-limit 10000
set-option -g default-shell /bin/zsh
# Pane switching with Alt+arrow
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
# # pane navigation
# bind -n M-h select-pane -L # move left
# bind -n M-j select-pane -D # move down
# bind -n M-k select-pane -U # move up
# bind -n M-l select-pane -R # move right
setw -g mode-keys vi
# Helps visual selection by pressing V
bind-key -T copy-mode-vi v send-keys -X begin-selection
# copy selected text wiht y
if-shell "uname | grep -q Darwin" "bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel \"pbcopy\"" "bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'"
if-shell "uname | grep -q Darwin" "bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel \"pbcopy\"" "bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel \"xclip -in -selection clipboard\""
set-option -g set-clipboard off
# Shift + arrows to resize pane
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Create new panes and windows with current path
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind-key -n "M-'" split-window -h -c "#{pane_current_path}"
bind-key -n M-/ split-window -v -c "#{pane_current_path}"
bind-key -n M-q confirm-before "kill-pane"
bind-key -n M-Q confirm-before "kill-window"
bind-key -n M-n new-window -c "#{pane_current_path}"
bind-key -n M-N new-session -c "#{pane_current_path}"
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-< swap-window -t -1
bind-key -n M-> swap-window -t +1
bind-key -n M-R command-prompt -I "" "rename-window '%%'"
bind-key -n M-d resize-pane -Z \; choose-tree -w -F "#{pane_current_path} - #{pane_current_command}"
bind-key -n M-f resize-pane -Z
# pane movement
bind-key -n M-g command-prompt -p "horizontal join pane:" "join-pane -v -s '%%'"
bind-key -n M-v command-prompt -p "vertical join pane to:" "join-pane -h -s '%%'"
bind-key -n M-B break-pane
bind-key -n M-m command-prompt -p "move pane to:" "move-pane -t '%%'"
# mark and swap panes
bind-key -n M-x select-pane -m # mark
bind-key -n M-X select-pane -M # unmark
bind-key -n M-z join-pane
# select layout
bind-key -n M-w select-layout main-vertical
bind-key -n M-e select-layout main-horizontal
bind-key -n M-W select-layout even-vertical
bind-key -n M-E select-layout even-horizontal
# rotate window
bind-key -n M-r rotate-window
bind-key -n M-` move-window -t 0
# Quick view of processes
bind-key p split-window -v 'exec htop'
# Help screen: rebind list-keys window into a new pane
bind-key ? split-window -h 'exec tmux list-keys | less'
bind-key -n M-u if-shell -F '#{==:#{session_name},scratch}' {
detach-client
} {
display-popup -E "tmux new-session -A -s scratch"
}
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# switch to last pane
bind-key C-a last-pane
# Use mouse to select pane
set -g mouse on
# Focus events to panes
# set -g focus-events on
# Activity monitoring
# setw -g monitor-activity on
# set -g visual-activity on
setw -g window-status-activity-style none
# # Status Bar ---------------------
# #
# set -g status on
# # soften status bar colors
# set -g status-bg "#586e75"
# set -g status-fg "#eee8d5"
# # remove administrative debris (session name, hostname, time) in status bar
# set -g status-left ""
# set -g status-right ""
# set -g status-justify centre
# set-option -g status-left-length 50
# set-option -g status-right "Battery: #{battery_icon} #{battery_percentage} #{battery_remain} | #(date \'+%a, %b %d - %I:%M\')"
# set -g status-left "Session: #S"
#
# 12 hour time
set-window-option -g clock-mode-style 12
bind-key X run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session'
# Enable Tmux Package Manager
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-open'
# Install the Hide Pane plugin
set -g @plugin 'git@gitlab.com:Jrahme/tmux-hide-pane.git'
# set -g @plugin 'jimeh/tmux-themepack'
# set -g @themepack 'powerline/double/yellow'
# set -g @plugin 'odedlaz/tmux-onedark-theme'
# set -g @plugin 'ch1r0x/papercolor-light-tmux'
# source-file ~/.tmux/iceberg_minimal.tmux.conf
# set -g @plugin 'egel/tmux-gruvbox'
# set -g @tmux-gruvbox 'dark'
setenv -g SHOW_DIRECTORY_NAME 1
# set -g @plugin 'git@gitlab.com:Jrahme/tmux-float.git'
# set -g @plugin 'shivamashtikar/tmux-gruvbox-truecolor'
set -g @plugin 'shivamashtikar/tmux-onedark-theme'
# source-file ~/.tmux/plugins/tmux-gruvbox/tmux-gruvbox-dark.conf
set -g status-position top
# set -g @themepack 'basic'
# Light theme
# set -g @plugin 'mkoga/tmux-solarized'
# Reload tmux.conf file
bind R source-file ~/.tmux.conf \; display "Reloaded .tmux.conf file"
# Override time for status line for 12 hour clock
# set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %I:%M:%S %p #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour100,bg=colour240]#[fg=colour233,bg=colour100,bold] #H "
set -g @continuum-restore 'on'
# TMUX Resurrect
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'sunaku/tmux-navigate'
set -g @navigate-left '-n M-h'
set -g @navigate-down '-n M-j'
set -g @navigate-up '-n M-k'
set -g @navigate-right '-n M-l'
set -g @navigate-back '-n M-\'
bind-key -n M-o run-shell -b "~/.tmux/plugins/tmux-fzf/scripts/window.sh switch"
TMUX_FZF_ORDER="window|session|pane|command|keybinding|clipboard|process"
TMUX_FZF_WINDOW_FORMAT="#{pane_current_command} | #{pane_current_path}"
TMUX_FZF_PANE_FORMAT="#{pane_current_command} | #{pane_current_path}"
TMUX_FZF_PREVIEW=0
set -g @plugin 'sainnhe/tmux-fzf'
# Run the Tmux Package Manager (Must be at the bottom)
run '~/.tmux/plugins/tpm/tpm'