-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
182 lines (135 loc) · 4.64 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
# ____ _
# / ___| ___ _ __ ___ _ __ __ _| |
# | | _ / _ \ '_ \ / _ \ '__/ _` | |
# | |_| | __/ | | | __/ | | (_| | |
# \____|\___|_| |_|\___|_| \__,_|_|
set-option -g default-shell /usr/bin/fish
# vim conflict fix
set -sg escape-time 0
# scrollback size
set -g history-limit 30000
# tmux messages are displayed for 2 seconds
set -g display-time 2000
# refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# set only on OS X where it's required
#set -g default-command "reattach-to-user-namespace -l $SHELL"
# upgrade $TERM
set -g default-terminal "screen-256color"
# focus events enabled for terminals that support them
set -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# Attach to a session if runs otherwise create a new one
new-session -n $HOST
# 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
# Set up a basic panel structure for command + ctr D
bind D source-file ~/.tmux/dev
# Enable mouse
set -g mouse on
####################################
# --- Selection and copy-paste
setw -g mode-keys vi
set-option -s set-clipboard off
# Copy from tmux to system clipboard
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -sel clip -i"
# mouse copy
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -sel clip -i"
# _ __ _ _ _
# | |/ /___ _ _| |__ (_)_ __ __| |___
# | ' // _ \ | | | '_ \| | '_ \ / _` / __|
# | . \ __/ |_| | |_) | | | | | (_| \__ \
# |_|\_\___|\__, |_.__/|_|_| |_|\__,_|___/
# |___/
# Changing ctrl b to alt a as the command button
unbind C-b
set -g prefix M-a
# 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
# Copy mode with c
unbind v
bind-key v copy-mode
# Redraw the client (if interrupted by wall, etc)
bind C-R refresh-client
# reload tmux config with alt + a + R
unbind R
bind R source-file ~/.tmux.conf \; display 'Reloaded tmux config.'
# New window to the right -> l
unbind l
bind-key l split-window -h -c "#{pane_current_path}"
# New window to the bottom -> j
unbind j
bind-key j split-window -c "#{pane_current_path}"
# alt - r rename window
unbind r
bind r command-prompt -I "#W" "rename-window '%%'"
# Ctrl - t or t new window
unbind t
bind-key t new-window -c "#{pane_current_path}"
# Ctrl - w or w to kill window
unbind w
bind-key w kill-window
# alt + q to kill pane
unbind M-q
bind -n M-q kill-pane
# q to kill session
unbind q
bind-key q kill-session
# go to last session
unbind b
bind -n M-b switch-client -l
# Switching panes with alt + vim keys
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
# resize panes with alt + upper cased vim keys
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# List windows with x
bind x list-windows
# alt + m : Next window
unbind M-m
bind -n M-m next-window
# alt + n : Previous window
unbind M-n
bind-key -n M-n previous-window
# Cycle through command outputs
bind-key -n M-o copy-mode \; send-keys -X search-backward "(❯|❮)"
# 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
# ____ _ _ ____
# / ___|| |_ __ _| |_ _ _ ___ | __ ) __ _ _ __
# \___ \| __/ _` | __| | | / __| | _ \ / _` | '__|
# ___) | || (_| | |_| |_| \__ \ | |_) | (_| | |
# |____/ \__\__,_|\__|\__,_|___/ |____/ \__,_|_|
set -g status 'on'
set -g status-bg '0'
set -g status-justify 'right'
set -g status-left-length '100'
set -g status-right-length '100'
setw -g window-status-separator ''
set -g status-right '#[fg=#383838,bg=colour0,nobold,nounderscore,noitalics]#[fg=#A0FFA0,bg=#383838,bold] #S #[fg=#383838,bg=colour0,nobold,nounderscore,noitalics]'
set -g status-left ''
setw -g window-status-format '#[fg=colour0,bg=colour0,nobold,nounderscore,noitalics]#[fg=#A0FFA0,bg=colour0] #I #W #[fg=colour0,bg=colour0,nobold,nounderscore,noitalics]'
setw -g window-status-current-format '#[fg=#383838,bg=colour0,nobold,nounderscore,noitalics]#[fg=#A0FFA0,bg=#383838,bold] #I #W #[fg=#383838,bg=colour0,nobold,nounderscore,noitalics]'