-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf.symlink
185 lines (151 loc) · 4.46 KB
/
.tmux.conf.symlink
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
set-option -g default-shell /bin/zsh
# set terminal to 256 colors
#set -g default-terminal "screen-256color"
#
set -sg escape-time 0
#
# enable utf 8
set -g status on
set -g status-utf8 on
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server
set -g lock-command vlock
set -g lock-after-time 1800
set -g lock-server on
# screen ^C c
unbind ^C
bind ^C new-window
unbind c
bind c new-window
# detach ^D d
unbind ^D
bind ^D detach
# displays *
unbind *
bind * list-clients
# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window
# title A
unbind A
bind A command-prompt "rename-window %%"
# other ^A
unbind ^A
bind ^A last-window
# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window
# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows
# quit \
unbind \
bind \ confirm-before "kill-server"
# kill K k
unbind K
bind K confirm-before "kill-window"
# redisplay ^L l
unbind ^L
bind ^L refresh-client
# More straight forward key bindings for splitting
unbind %
bind | split-window -h
bind - split-window -v
bind / command-prompt "split-window 'exec %%'"
bind S command-prompt "new-window -n %1 'ssh %1'"
# History
set -g history-limit 4096
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# powerline setup
set-option -g status-bg colour235
set-option -g status-fg colour24
set -g status-attr bright
set-option -g status on
set-option -g status-interval 2
set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 80
set-option -g status-right-length 50
set -g status-left '#[fg=colour255, bg=colour24] #(date +"%H:%M") #[fg=colour24, bg=colour32]#[fg=colour255, bg=colour32] [#S] #[fg=colour32, bg=colour235]'
set -g status-right '#[fg=colour32, bg=colour235]#[fg=colour255, bg=colour32] #H #[fg=colour24, bg=colour32]#[fg=colour255, bg=colour24] #(date +"%F") '
set-window-option -g window-status-current-format "#[fg=colour24, bg=colour235]#[fg=colour255, bg=colour24] #I | #W #[fg=colour24, bg=colour235]"
set-window-option -g window-status-format "#[fg=colour250, bg=colour24] #I|#W "
# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity off
# Clock
setw -g clock-mode-style 24
# Panes
set -g mouse-resize-pane on
set -g mouse-select-pane on
# Windows
set -g mouse-select-window on
setw -g mode-mouse on
# " windowlist -b
bind a choose-window
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
# to paste
bind-key C-v run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
setw -g display-panes-time 2000
bind ^s display-panes \; command-prompt "swap-pane -s %1"
# panes start at 1
set -g base-index 1
set -g pane-base-index 1
bind c new-window -c '#{pane_current_path}'
bind C-p last-window
set-option -g mouse-select-pane on
set-option -g mouse-resize-pane on
set-option -g mouse-select-window on
# smart pane switching with awareness of emacs splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-l) || tmux select-pane -R"
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
bind - resize-pane -U 2
bind _ resize-pane -U 16
bind = resize-pane -D 2
bind + resize-pane -D 16
bind 9 resize-pane -L 6
bind ( resize-pane -L 24
bind 0 resize-pane -R 6
bind ) resize-pane -R 24
set -g detach-on-destroy off
setw -g alternate-screen off
bind M-l next-layout
set -g terminal-overrides 'xterm:colors=256'