forked from justone/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
169 lines (116 loc) · 4.22 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
# some of the regular tmux keys
bind-key ? list-keys
bind-key Space next-layout
bind-key '~' show-messages
bind-key i display-message
bind-key x confirm-before -p "kill-pane #P? (y/n)" kill-pane
bind-key X confirm-before -p "kill-window #W? (y/n)" kill-window
bind-key C-x confirm-before -p "kill-session #S? (y/n)" kill-session
bind-key R command-prompt -I "#S" "rename-session '%%'"
bind-key r command-prompt -I "#W" "rename-window '%%'"
bind-key s choose-session
bind-key \ switch-client -l
bind-key C command-prompt -I "#S" "new-session -s '%%'"
bind-key z resize-pane -Z
bind-key D choose-client
bind-key d detach-client
bind-key c new-window -c "#{pane_current_path}"
bind-key n next-window
bind-key p previous-window
bind-key w choose-window
# change prefix to Ctrl-a (like in gnu-screen)
set-option -g prefix C-a
bind-key C-a send-prefix
# shell
set -g default-command $SHELL
set -g default-shell $SHELL
# start with 1 (instead of 0)
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
# screen mode
set default-terminal "screen-256color"
set -g xterm-keys on
set -g terminal-overrides "putty*:kLFT@:kRIT@:kLFT5=\e[D:kRIT5=\e[C:kUP5=\e[A:kDN5=\e[B"
# set terminal title
set -g set-titles on
set -g set-titles-string "#T"
# source config file
bind l source-file ~/.tmux.conf \; display "Config reloaded..."
# history
set -g history-limit 100000
# automatically set window title
set -g automatic-rename on
# copy mode
bind Escape copy-mode
bind PPage copy-mode -u
bind '#' list-buffers
bind = choose-buffer
bind - delete-buffer
bind ] paste-buffer
bind -Tcopy-mode-vi v send -X begin-selection
bind -Tcopy-mode-vi y send -X copy-pipe "xsel -i -b"
bind y run "tmux show-buffer | xsel -i -b"
# use vi mode
setw -g mode-keys vi
set -g status-keys vi
# Allows for faster key repetition
set -s escape-time 0
# globally enable mouse support
set -g mouse on
bind -n WheelUpPane if-shell -F "#{alternate_on}" "send-keys -M" "select-pane -t= \; copy-mode -e \; send-keys -M"
bind -n C-WheelUpPane if-shell -F "#{alternate_on}" "send-keys -M" "select-pane -t= \; copy-mode -e \; send-keys -M"
bind -n WheelDownPane if-shell -F "#{alternate_on}" "send-keys -M" "select-pane -t= \; send-keys -M"
bind -Tcopy-mode-vi WheelUpPane send -X halfpage-up
bind -Tcopy-mode-vi WheelDownPane send -X halfpage-down
bind -Tcopy-mode-vi C-WheelUpPane send -X scroll-up
bind -Tcopy-mode-vi C-WheelDownPane send -X scroll-down
# splitting
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# window handling
bind -n M-\ last-window
bind -n "M-'" new-window -c "#{pane_current_path}"
bind -n "M-\"" new-window
bind -n M-[ previous-window
bind -n M-] next-window
bind -n M-u next-window -a
bind m command-prompt -p "Move window to:" "swap-window -t '%%'"
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# colon :
bind : command-prompt
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
# smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# this key is rather used in MC
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# open progress view
bind v split-window -v -p 10 -c "#{pane_current_path}" "progress -m"
# resize panes with vim movement keys
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
# window mode
setw -g mode-bg colour6
setw -g mode-fg colour0
# use tmuxline generated config
source-file ~/.config/tmux/solarized.conf
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity on
set-option -g bell-action any
# tmux clock
set -g clock-mode-colour blue
bind-key t clock-mode