-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
109 lines (82 loc) · 4.04 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
# Set prefix to Ctrl-Space
# Important: the Ctrl-Space might not work on Mac because it's already binded by
# the system. Check the iTerm profile and more importantly: Preferences >
# Keyboard > Shortcuts. If present, select "Input sources" from the left sidebar
# and uncheck both boxes. Source: https://github.com/tmux/tmux/issues/457#issuecomment-357938515
unbind C-b
set -g prefix C-Space
# Bindings:
# - to see current bindings:
# tmux list-keys
# Open new/split panes with the path of the current pane.
unbind-key c
bind-key c new-window -c '#{pane_current_path}'
unbind-key %
bind-key % split-window -h -c '#{pane_current_path}'
unbind-key '"'
bind-key '"' split-window -v -c '#{pane_current_path}'
# Vim-like key bindings for pane navigation (default uses cursor keys).
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l
bind l select-pane -R
# Resizing (mouse also works).
unbind-key Left
bind-key -r Left resize-pane -L 5
unbind-key Right
bind-key -r Right resize-pane -R 5
unbind-key Down
bind-key -r Down resize-pane -D 5
unbind-key Up
bind-key -r Up resize-pane -U 5
# Intuitive window-splitting keys.
bind-key | split-window -h -c '#{pane_current_path}' # normally prefix-%
bind-key '\' split-window -h -c '#{pane_current_path}' # normally prefix-%
bind-key - split-window -v -c '#{pane_current_path}' # normally prefix-"
# Mouse can be used to select panes, select windows (by clicking on the status
# bar), resize panes. For default bindings see `tmux list-keys`.
set-option -g mouse on
# Stay in copy mode on drag end.
# (Would use `bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X
# stop-selection` but it is a bit glitchy.)
unbind-key -T copy-mode-vi MouseDragEnd1Pane
# Scroll 3 lines at a time instead of default 5; don't extend dragged selections.
bind-key -T copy-mode-vi WheelUpPane select-pane\; send-keys -t'{mouse}' -X clear-selection\; send-keys -t'{mouse}' -X -N 3 scroll-up
bind-key -T copy-mode-vi WheelDownPane select-pane\; send-keys -t'{mouse}' -X clear-selection\; send-keys -t'{mouse}' -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 -t'{mouse}' -X select-word"
bind-key -T root TripleClick1Pane if-shell -Ft'{mouse}' '#{alternate_on}' "send-keys -M" "copy-mode -t'{mouse}'; send-keys -t'{mouse}' -X select-line"
# Don't exit copy mode on double or triple click.
bind-key -T copy-mode-vi DoubleClick1Pane if-shell -Ft'{mouse}' '#{alternate_on}' "send-keys -M" "copy-mode -t'{mouse}'; send-keys -t'{mouse}' -X select-word"
bind-key -T copy-mode-vi TripleClick1Pane if-shell -Ft'{mouse}' '#{alternate_on}' "send-keys -M" "copy-mode -t'{mouse}'; send-keys -t'{mouse}' -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-option -w -g main-pane-width 85
set-option -g default-terminal "tmux-256color"
set-option -ga terminal-overrides ',xterm-256color:Tc'
set-option -g history-limit 10000
# Start window and pane numbering at 1, (0 is too hard to reach).
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Don't wait for an escape sequence after seeing C-Space.
set-option -s escape-time 0
# Dynamically update iTerm tab and window titles.
set-option -g set-titles on
# Needed as on tmux 1.9 and up (defaults to off).
# Added in tmux commit c7a121cfc0137c907b7bfb.
set-option -g focus-events on
# But don't change tmux's own window titles.
set-option -w -g automatic-rename off
# Don't wrap searches; it's super confusing given tmux's reverse-ordering of
# position info in copy mode.
set-option -w -g wrap-search off
# - #S = session name
# - #T = pane title (~/.zshrc sets this to the last/current command)
set-option -g set-titles-string "#S > #T"
# Add : to the default list (" -_@") of word separators.
set-option -ga word-separators :/