-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
120 lines (92 loc) · 3.91 KB
/
dot_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
set-option -g status-keys emacs
set-window-option -g mode-keys vi
# tmux normally sets the default terminal to "screen" which
# only supports 8 colors. So then we lose the pretty ls
# colouring. :(
set-option -g default-terminal "xterm-256color"
# True color override
set-option -ag terminal-overrides ',xterm-256color:Tc'
# Fix for drawing borders correctly in containers
# https://github.com/tmux/tmux/issues/224
#if-shell "[ -f /.dockerenv ] || [ -f /run/.containerenv ]" \
# 'set-option -ag terminal-overrides \',*:cud1=\E[1B\''
# Change prefix to C-a, but only if we're not nested (this is set by our
# dotfiles `apply` script).
if-shell "[ ! -f ~/.tmux.conf.nested ]" {
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
}
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set-option -s escape-time 0
# display tmux messages for 4s
set-option -g display-time 4000
# refresh status bar more often
set-option -g status-interval 5
# allow focus events from terminal
set-option -g focus-events on
set-option -g history-limit 100000
set-option -g buffer-limit 100
set-option -g repeat-time 350
set-option -g mouse on
set-window-option -g allow-rename off
set-window-option -g xterm-keys on
set-window-option -g renumber-windows on
bind-key C-j select-pane -D
bind-key C-k select-pane -U
bind-key C-h select-pane -L
bind-key C-l select-pane -R
bind-key C-y run "tmux show-buffer | xsel -i"
bind-key C-p run "xsel -o | tmux load-buffer -"
bind-key -r M-k resize-pane -U 5
bind-key -r M-j resize-pane -D 5
bind-key -r M-h resize-pane -L 5
bind-key -r M-l resize-pane -R 5
bind-key -r k resize-pane -U
bind-key -r j resize-pane -D
bind-key -r h resize-pane -L
bind-key -r l resize-pane -R
# maximize height of this pane
bind-key e resize-pane -y 999
#bind-key -r { swap-pane -U
#bind-key -r } swap-pane -D
bind-key / last-window
bind-key \; last-pane
bind-key -r C-u swap-window -t +1 \; select-window -t +1
bind-key -r C-i swap-window -t -1 \; select-window -t -1
bind-key -r n next-window
bind-key -r p previous-window
bind-key C clear-history
# this is like Enter, except it doesn't cause tmux to exit
# copy mode, so we can more easily copy multiple things in a
# row
bind-key -T copy-mode-vi C-j send-keys -X copy-selection
bind-key C-y run-shell "tmux show-buffer | xsel -bi"
# these are overrides for hotkeys that are already mapped
# the default doesn't include -u
bind-key s choose-tree
bind-key '"' split-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key v run-shell "tmux-paste-slow"
# GNOME Terminal doesn't support setting the clipboard, so
# it just looks like tmux barfs characters all over the
# screen when you copy a selection.
# http://askubuntu.com/questions/507214/
set-option -s set-clipboard off
# force a full redraw on bell events so that the target
# window's title gets highlighted right away in the status
# bar
# https://github.com/tmux/tmux/issues/685
set-hook -g alert-bell refresh-client
# allow longer session names without truncating
set-option -g status-left-length 30
# White on black rather than black on green, but only if we're not nested (this
# is set by our dotfiles `apply` script).
if-shell "[ ! -f ~/.tmux.conf.nested ]" {
set-option -g status-style 'bg=#000000,fg=white'
set-option -g window-status-style 'bg=#000000,fg=white'
set-option -g window-status-last-style 'bg=#000000,fg=white'
set-option -g window-status-current-style 'bg=#000000,fg=white,bold'
}
set-option -g pane-active-border-style 'fg=red'
set-option -g pane-border-lines 'heavy'