-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
207 lines (159 loc) · 6.38 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
# vim:ft=conf
# command prefix (like screen)
# set -g prefix C-a
# bind C-a send-prefix
set -g prefix2 C-x
bind C-x send-prefix
# prefix for inner tmux
bind-key -n C-f send-prefix
# Basic settings {{{
set -g default-command zsh
set -g default-shell /bin/zsh
# Default terminal is 256 colors
# set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"
# Number of lines held in window history
set -g history-limit 50000
# If you have issues scrolling with Shift-PageUp/Shift-PageDown in your
# terminal, try this:
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Add truecolor support
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Start Window Numbering at 1
set -g base-index 1
# mouse
# set-option -g mouse-select-pane off
# set-option -g mouse-select-window off
# set-window-option -g mode-mouse off
set-window-option -g aggressive-resize on
set-option -g renumber-windows on
set -sg escape-time 50
# }}}
# Key bindings {{{
set-window-option -g mode-keys vi
set-option -g status-keys vi
# v to select
# bind-key -t vi-copy 'v' begin-selection
# # y to yank
# bind-key -t vi-copy 'y' copy-selection
# # P to paste
unbind P
bind P paste-buffer
# reload tmux.conf
bind-key r source-file ~/.tmux.conf \; display-message " Config reloaded..."
bind k confirm-before "kill-window"
#bind l refresh-client
bind m command-prompt "split-window 'exec man %%'"
bind '&' split-window "exec htop"
# browse URLs
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlscan < /tmp/tmux-buffer"'
# copy mode to escape key
# unbind [
# bind Escape copy-mode
# next/previous tab (-n: no prior escape seq)
bind-key -n M-Right next
bind-key -n M-Left prev
bind -n M-S-left swap-window -t -1
bind -n M-S-right swap-window -t +1
bind S command-prompt -p "Make/attach session:" "new-window 'tmuxstart \'%%\''"
# Ctrl-prefix-o to highlight and open URLs
# https://github.com/dequis/tmux-url-select
# bind o run /home/paul/bin/tmux-url-select.pl
# Restore Clear Screen (C-l)
bind C-l send-keys 'C-l'
# }}}
# Windows {{{
# Saner splitting.
bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}'
bind S choose-session
# bind C-j previous-window
# bind C-k next-window
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# }}}
# Plugins {{{
run-shell ~/lib/dotfiles/tmux/copycat/copycat.tmux
run-shell ~/lib/dotfiles/tmux/yank/yank.tmux
# run-shell ~/lib/dotfiles/tmux/tmux-maildir-counter/maildir_counter.tmux
# set -g @maildir_counters '~/Mail/sconseil/INBOX/new|~/Mail/saimon/INBOX/new|~/Mail/cral/INBOX/new'
# }}}
# Appearance {{{
# window title
# [window number,program name,active] (or not)
set-option -g set-titles on
set-option -g set-titles-string '[tmux #S:#I.#P] #T - #W'
set-window-option -g automatic-rename on # auto name
# messages
set-option -g message-style fg=black,bg=magenta
# Set window notifications
set -g visual-bell off
set-option -g visual-activity on
set-window-option -g monitor-activity on
# status bar
set-option -g status-justify centre
set-option -g status-bg brightblack
set-option -g status-fg white
set-option -g status-interval 60
set-option -g status-left-length 30
set-option -g status-left '#[fg=brightblack,bold,bg=green] #h #[default]#[bg=black,fg=green,nobold]#[bg=black,fg=green] #S #[default]#[bg=brightblack,fg=black]'
# set-option -g status-right '#[fg=blue,bold]###S #[fg=magenta]#(uptime | cut -d ":" -f5-) » %R %a %d/%m#(acpi | cut -d ',' -f 2)#[default]'
set-option -g status-right-length 50
set-option -g status-right '#[default] #[fg=red,bold]%H:%M#[default]'
# Highlight active window
#FIXME: I want to be able to use: ⮁
set-window-option -g window-status-bell-style fg=black,bg=red
set-window-option -g window-status-activity-style fg=black,bg=red,bold
# set-window-option -g window-status-separator ⮁
# set-window-option -g window-status-separator
#set-window-option -g window-status-current-fg white
#set-window-option -g window-status-current-bg blue
setw -g window-status-format '#[fg=white,bold] #I #W #[default]'
setw -g window-status-current-format '#[bg=brightgreen,fg=brightblack] #[fg=black,bold]#I #W #[bg=brightblack,fg=brightgreen,nobold]'
# Source config file generated by tmuxline
source-file ~/lib/dotfiles/tmuxline.conf
set -g pane-active-border-style fg=red,bg=default
set -g pane-border-style fg=green,bg=default
# clock
#set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 24
# https://github.com/tmux-plugins/vim-tmux-focus-events
set -g focus-events on
# }}}
# Ctrl-b c Create new window
# Ctrl-b d Detach current client
# Ctrl-b l Move to previously selected window
# Ctrl-b n Move to the next window
# Ctrl-b p Move to the previous window
# Ctrl-b w List all windows / window numbers
# Ctrl-b & Kill the current window
# Ctrl-b , Rename the current window
# Ctrl-b % Split the window vertically
# Ctrl-b " Split window horizontally
# Ctrl-b q Show pane numbers (used to switch between panes)
# Ctrl-b o Switch to the next pane
# Ctrl-b ? List all keybindings
# Ctrl-b <number> Move to the specified window number
# Ctrl-b { Move the current pane left
# Ctrl-b } Move the current pane right
# Ctrl-b Ctrl-arrow resize a split
# Ctrl-b Ctrl-o swap split
# You can have tmux open a session with preloaded windows by including those
# details in your .tmux.conf
# neww [-adk] [-n window-name] [-t target-window] [shell-command]
# initialize sessions
# bind M source-file ~/lib/dotfiles/tmux.main.conf
# bind B source-file ~/.tmux/bar
source-file ~/.tmux.local