-
Notifications
You must be signed in to change notification settings - Fork 6
/
.tmux.conf
115 lines (99 loc) · 3.58 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
#see: http://mutelight.org/articles/practical-tmux
set -g status-style fg=white,bold,bg=colour92
# TODO: set statusbar color based on hash of #{session_name} #(whoami) #(hostname -f)
#display-message "#(echo "$((16#$(echo "$(whoami)@$(hostname -f)" | openssl dgst -r | head -c2)))")"
# give me more history
set-option -g history-limit 100000
set-option -g display-time 1500 # 750ms is too little time to read anything
# Be more like screen(1): use CTRL+A prefix
set-option -g prefix C-a
bind-key C-a last-window
bind-key a send-prefix
#be more mouse-user-friendly
set -g mouse
# allow osc52 to work
set -g set-clipboard on
# allow nvim 'autoread' to work
set-option -g focus-events on
#be more vi-user-friendly
set-option -g status-keys vi
set-window-option -g mode-keys vi
bind-key -r h select-pane -L
bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r l select-pane -R
#Windows-esque bindings
bind-key C-c copy-mode
bind-key C-v paste-buffer -p
# C-u is the vim-esque page-up. (emacs too?)
bind-key C-u copy-mode -u
# support block-visual mode:
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send -X copy-selection
unbind-key -T copy-mode-vi v
# Unsupported?
#set-option -g mouse-select-pane on
#set-option -g mouse-select-window on
#set-window-option -g mode-mouse off
# Avoid cancelling copy-mode if the pane history has been scrolled.
bind-key -T copy-mode-vi MouseDragEnd1Pane {
if -F "#{scroll_position}" {
send -X copy-pipe
} {
send -X copy-pipe-and-cancel
}
}
#Make the Page-Up key do (something similar to) what you'd expect:
#TODO: make this only bound in normal-mode.
#bind-key -n PPage copy-mode -u
# Make vim respond to esc quickly
set-option -sg escape-time 0
# let me repeat commands slowly (e.g. ^A ^N ^N)
#TOO SLOW! bug? repeat happens even for non-repeating commands
##set-option -sg repeat-time 1500
# Give me some room on the left, but still enable five shortcuts (C-A,6) to the right.
set -g base-index 5
# Helps when i connect to a session from multiple places
setw -g aggressive-resize on
# Enable 256 color support, for vim, etc.
set-option -g default-terminal xterm-kitty # faster and less bugs than screen
set-option -ga terminal-overrides ",*256col*:Tc"
set-option -ga terminal-overrides ",*-direct:Tc"
set-option -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION SSH_TTY WINDOWID XAUTHORITY"
# Some things don't really need a prefix key
bind-key -n C-Left previous-window
bind-key -n C-Right next-window
bind-key -n M-h previous-window
bind-key -n M-l next-window
bind-key -n M-j select-pane -U
bind-key -n M-k select-pane -D
# Let me hold the ctrl key down.
# These were generated via:
# tmux list-keys | grep -v -- ' [CM]-' | sed 's/ */ C-/'
bind-key C-Space send-prefix
bind-key C-? list-keys
bind-key C-D choose-client
bind-key C-L switch-client -l
bind-key C-[ copy-mode
bind-key C-] paste-buffer -p
# C-c is windows-esque copy mode
#bind-key C-c new-window
bind-key C-d detach-client
bind-key C-f command-prompt "find-window '%%'"
bind-key C-i display-message
bind-key -r C-l last-window
bind-key -r C-n next-window
bind-key C-o select-pane -t :.+
bind-key -r C-p previous-window
bind-key C-q display-panes
bind-key C-r refresh-client
bind-key C-s choose-session
bind-key C-t clock-mode
bind-key C-w choose-window
bind-key C-x confirm-before -p "kill-pane #P? (y/n)" kill-pane
bind-key C-PPage copy-mode -u
bind-key -r C-Up select-pane -U
bind-key -r C-Down select-pane -D
bind-key -r C-Left select-pane -L
bind-key -r C-Right select-pane -R