-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
54 lines (41 loc) · 2.48 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
#bind-key [-nr] [-T key-table] key command [arguments]
# (alias: bind)
# Bind key key to command. Keys are bound in a key table. By default (without -T), the key is bound in the prefix key table. This table is
# used for keys pressed after the prefix key (for example, by default ‘c’ is bound to new-window in the prefix table, so ‘C-b c’ creates a new
# window). The root table is used for keys pressed without the prefix key: binding ‘c’ to new-window in the root table (not recommended) means
# a plain ‘c’ will create a new window. -n is an alias for -T root. Keys may also be bound in custom key tables and the switch-client -T com‐
# mand used to switch to them from a key binding. The -r flag indicates this key may repeat, see the repeat-time option.
# To view the default bindings and possible commands, see the list-keys command.
set-window-option -g mode-keys vi
set-window-option -g xterm-keys on
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g default-terminal "xterm-color"
set -g mouse off
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -se c -i"
set-option -g history-limit 999999999
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Ctrl-Up/Down cyles thru panes (no prefix)
bind-key -n "S-Up" select-pane -t :.- \; display-panes
bind-key -n "S-Down" select-pane -t :.+ \; display-panes
# Use vim type keys for re-sizing panes
bind -r < resize-pane -L 1
bind -r > resize-pane -R 1
bind -r - resize-pane -D 1
bind -r + resize-pane -U 1
bind -n M-r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi Y send-keys -X copy-pipe "xclip -sel clip -i" \; display-message "Copied to clipboard"
bind-key -n C-x run-shell "~/bin/tmux-autocomplete >/tmp/tmux-autocomplete.log 2>&1"
# Split window horizontally and vertically.
bind-key -T prefix -n | split-window -h -c '#{pane_current_path}'
bind-key -T prefix -n _ split-window -v -c '#{pane_current_path}'
unbind-key -n Pageup
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
#bind-key -n Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind-key -n S-Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind-key -n S-Pagedown send-keys Pagedown