-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
202 lines (165 loc) · 5.24 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
# scrollback size
set -g history-limit 10000
################################
# Keybinds
###############################
# Changing ctrl b to ctrl a as the command button
unbind C-b
set -g prefix C-a
# Set terminal colours (colours will look muted without this)
set -g default-terminal "screen-256color"
# set first window to index 1 (not 0) to map more to the keyboard layout
set -g base-index 1
set -g pane-base-index 1
# pass through xterm keys
set -g xterm-keys on
# Keep your finger on ctrl, or don't, same result
bind-key C-d detach-client
bind-key C-p paste-buffer
# Redraw the client (if interrupted by wall, etc)
bind R refresh-client
# reload tmux config with ctrl + a + r
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config.'
# Vertical splits with g or C-g
unbind g
unbind C-g
bind-key g split-window -h
bind-key C-g split-window -h
# Horizontal splits with v or C-h
unbind h
unbind C-h
bind-key h split-window
bind-key C-h split-window
# Ctrl + a + o rename window
# unbind o
# unbind C-o
# bind-key C-o rename-window
# Using the mouse to switch panes
set -g mouse on
# Ctrl - t or t new window
unbind t
unbind C-t
bind-key t new-window
bind-key C-t new-window
# Ctrl - w or w to kill panes
unbind w
unbind C-w
bind-key w kill-pane
bind-key C-w kill-pane
# C + control q to kill session
unbind q
unbind C-q
bind-key q kill-session
bind-key C-q kill-session
# Switching panes with alt
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
# Ctrl + a + n : New session
unbind n
unbind C-n
bind-key n new-session
bind-key C-n new-session
# Ctrl + a + Pagedown : Next window
#unbind Pagedown
unbind Pagedown
bind-key Pagedown next-window
# Ctrl + a + Pagup : Previous window
#unbind Pageup
unbind Pageup
bind-key Pageup previous-window
# Use shift + arrow key to move between windows in a session
bind -n S-Left previous-window
bind -n S-Right next-window
# Zoom with ctrl + a + ctrl + '+'
#unbind C-+
#bind C-+ \
#new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read'\;\
#swap-pane -s tmux-zoom.0 \;\
#select-window -t tmux-zoom
# Zoom back ctrl + a + ctrl + '-'
#unbind C--
#bind C-- \
# last-window \;\
# swap-pane -s tmux-zoom.0 \;\
# kill-window -t tmux-zoom
# Visual Activity Monitoring between windows
setw -g monitor-activity on
set -g visual-activity on
# Show tmux positions in titles
set -g set-titles on
# Use vi key bindings
set-window-option -g mode-keys vi
# In copy mode, make v and y start and finish selections
# Similar to vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Set up a basic panel structure for command + ctr D
bind D source-file ~/.tmux/dev
# Attach to a session if runs otherwise create a new one
new-session -n $HOST
# ---------------------------
# LAYOUT / STYLE
# ---------------------------
#####################################
# Plugins
#https://github.com/tmux-plugins/tpm
####################################
#####################################
# tpm plugin manager
# https://github.com/tmux-plugins/tpm
# Install: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
#####################################
set -g @plugin 'tmux-plugins/tpm'
#####################################
# tmux-sensible - basline settings that get overwritten from .tmux.conf
# https://github.com/tmux-plugins/tmux-sensible
######################################
#set -g @plugin 'tmux-plugins/tmux-sensible'
#####################################
# tmux-resurrect - save and reload sessions and windows after a restart
# https://github.com/tmux-plugins/tmux-resurrect
# Default keybinds : save - command + c + s && restore command + c + r
######################################
set -g @plugin 'tmux-plugins/tmux-resurrect'
### tmux-resurrect extra settings ###
# keep vim sessions after reboot
set -g @resurrect-strategy-vim 'session'
# keep pane contents
set -g @resurrect-capture-pane-contents 'on'
# restore bash history
set -g @resurrect-save-bash-history 'on'
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
### /tmux-resurrect extra settings ###
######################################
# tmux-continuum - automatically save and restore tmux sessions
# https://github.com/tmux-plugins/tmux-continuum
#####################################
set -g @plugin 'tmux-plugins/tmux-continuum'
# Restore last saved enviroment
set -g @continuum-restore 'on'
# Set autosave interval
set -g @continuum-save-interval '5'
# Show continiuum state in statusbar
#set -g status-right 'Continuum status: #{continuum_status}'
# Starting tmux with system https://github.com/tmux-plugins/tmux-continuum/blob/master/docs/automatic_start.md
######################################
# tmux-yank - advanced copy mode
# https://github.com/tmux-plugins/tmux-yank
#####################################
set -g @plugin 'tmux-plugins/tmux-yank'
######################################
# tmux-themepack - themes
# https://github.com/jimeh/jimeh
#####################################
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/block/blue'
# initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'