-
Notifications
You must be signed in to change notification settings - Fork 6
/
.tmux.conf
101 lines (80 loc) · 4.03 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
# Horizontal split keybindings
bind | split-window -h -c "#{pane_current_path}"
bind \\ split-window -h -c "#{pane_current_path}"
unbind %
# Vertical split keybinding
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
# Prevent select-pane from eating next direction key by binding them without -r
bind-key Up select-pane -U
bind-key Right select-pane -R
bind-key Down select-pane -D
bind-key Left select-pane -L
# Bind hjkl to select-pane
bind-key k select-pane -U
bind-key l select-pane -R
bind-key j select-pane -D
bind-key h select-pane -L
# Mouse can be used to select panes, select windows (by clicking on the status
# bar), resize panes. Default bindings (as per `list-keys`) are:
#
# bind-key -T root MouseDown1Pane select-pane -t = ; send-keys -M
# bind-key -T root MouseDown1Status select-window -t =
# bind-key -T root MouseDown3Pane select-pane -m -t =
# bind-key -T root MouseDrag1Pane if-shell -F -t = #{mouse_any_flag} "if -Ft= "#{pane_in_mode}" "copy-mode -M" "send-keys -M"" "copy-mode -M"
# bind-key -T root MouseDrag1Border resize-pane -M
#
set -g mouse on
# Stay in copy mode on drag end.
unbind-key -T copy-mode-vi MouseDragEnd1Pane
# Clear selection on click; makes for nicer consecutive drags.
bind-key -T copy-mode-vi MouseDown1Pane send-keys -X clear-selection
# Scroll 3 lines at a time instead of default 5; don't extend dragged selections.
bind-key -T copy-mode-vi WheelUpPane send-keys -X clear-selection\; send-keys -X -N 3 scroll-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X clear-selection\; send-keys -X -N 3 scroll-down
# Make double and triple click work outside of copy mode (already works inside it with default bindings).
bind-key -T root DoubleClick1Pane if-shell -Ft{mouse} '#{alternate_on}' "send-keys -M" "copy-mode -t{mouse}; send-keys -X select-word"
bind-key -T root TripleClick1Pane if-shell -Ft{mouse} '#{alternate_on}' "send-keys -M" "copy-mode -t{mouse}; send-keys -X select-line"
# Slightly more useful width in "main-vertical" layout; enough room for 3-digit
# line number gutter in Vim + 80 columns of text + 1 column breathing room
# (default looks to be about 79)
set -w -g main-pane-width 85
set-option -g default-terminal "tmux-256color"
# status bar
set-option -g status-style bg=black,fg=white,none
set-option -g status-left-length 40
set-option -g status-left '#[fg=green]#{session_name} #[fg=blue]⧉ '
set-option -g status-right "#[fg=blue]$USER@#{host_short} #[fg=cyan]%l:%M"
# automatically renumber window numbers on closing a pane (tmux >= 1.7)
set-option -g renumber-windows on
# highlight active window
set-window-option -g window-status-style bg=black,fg=colour240,bold
set-window-option -g window-status-format \
'#[fg=yellow] #{window_index} #[default]#{window_name} '
set-window-option -g window-status-current-style fg=white,bg=colour237,none
set-window-option -g window-status-current-format \
'#[fg=magenta] #{window_index} #[default]#{window_name} '
# Turn off distracting border highlight.
set-option -ga pane-active-border-style bg=default,fg=default
# Start window indexing at 1
# (mainly nice because 0 is at the far right side of the keyboard)
set-option -g base-index 1
# Start pane indexing at 1 for tmuxinator
set-window-option -g pane-base-index 1
# 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.
set-window-option -g aggressive-resize on
# Increase scrollback limit
set-option -g history-limit 262144
# allow to pass on focus events to vim inside of tmux
# needed as on tmux 1.9 and up (defaults to off)
# added in tmux commit c7a121cfc0137c907b7bfb
set -g focus-events on
# vi style keys
set-option -g status-keys vi
# Set leader to Ctrl+Space
set-option -g prefix C-@
# Fix LSOpenURLsWithRole() error on OS X. Requires reattach-to-user-namespace
# to be installed.
set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL"