summaryrefslogtreecommitdiffstats
path: root/regress/conf/a4789a6782859c66aa8c9614ee6fabfa.conf
blob: 7f4a8cd19db1c11ce9cb39096f3b04f420c51ad4 (plain)
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
set -g default-command "if [ \"$(uname)\" = 'Darwin' ]; then exec reattach-to-user-namespace $SHELL; else exec $SHELL; fi"
set -g history-limit 32000
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION SSH_CLIENT SSH_TTY KRB5CCNAME Apple_PubSub_Socket_Render Apple_Ubiquity_Message"

# Reset SHLVL (otherwise it is 2 inside tmux)
setenv -g SHLVL 0

# Send esc faster so that neovim won't get so laggy
# https://github.com/neovim/neovim/issues/2093
set -g escape-time 100

# Disable paste detection
set -g assume-paste-time 0

# Titles and window names
set -g set-titles on
set -g set-titles-string "#T"

# Make it not so annoying/sticky to switch windows
set -g repeat-time 170

# Don't deattach me when a session ends
set -g detach-on-destroy off

# Make shift+keys work
setw -g xterm-keys on

# Prefix
set -g prefix ^A
unbind ^B
bind ^A send-prefix
bind a send-prefix

# Last window
bind ^a last

# Next & prev
bind ' ' next
bind '^ ' next
bind ^p prev

# Status
set -g status off
# Need more (cow)bells!
set -g bell-action any
set -g bell-on-alert on

# Detach
bind ^d detach

# Control the a tmux in a tmux
bind A send-prefix \; send-prefix
bind C send-prefix \; send-keys c
bind n send-prefix \; send-keys ' '
bind bspace send-prefix \; send-keys p
bind '#' send-prefix \; send-keys '"'

# Other key bindings.
bind ^r command-prompt "find-window '%%'"
bind '"' choose-tree -w
bind w split-window
bind W split-window -c "#{pane_current_path}"
bind ^w split-window
bind I list-windows
bind i list-windows
bind D neww 'if who | grep -q "$USER.* via mosh"; then tmux lsc -F "#{client_activity} #{client_tty}" | sort | head -n -1 | awk "{print \$2}" | xargs -n1 tmux detach -t; else for i in $(tmux lsc | cut -d: -f1 | grep -v "^$SSH_TTY$"); do tmux detach -t $i; done; fi'
bind S neww -t 999 'window=`tmux display -p "#{pane_title}"`; i=0; tmux list-windows | cut -d: -f1 | while read j; do if [ $j != $i ]; then tmux move-window -s $j -t $i; fi; i=$(($i+1)); done' # ; tmux find-window -T "$window"
bind ^s command-prompt "rename-session '%%'"
# Make the default HOME always ~
bind c neww -c ~
bind ^c new -c ~
bind escape copy-mode
# Copy to the OS clipboard
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "if [ \"$(uname)\" = 'Darwin' ]; then reattach-to-user-namespace pbcopy; else xclip; fi"
bind j command-prompt "join-pane -s '%%'"
bind ! break-pane -d
bind - command-prompt "move-pane -t '%%'"

# Makes `tmux a` work even when there isn't a session going on
new-session -A -c ~