-
Notifications
You must be signed in to change notification settings - Fork 16
/
.tmux.conf
116 lines (93 loc) · 4.83 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
116
# Enable 256-color support.
set -g default-terminal "screen-256color"
# Allow multiple instances of tmux to have different sizes. This is needed for
# tmux 3.0a on Ubuntu 20.04.
set -g aggressive-resize on
# Allow mouse to switch between windows and panes.
set -g mouse on
# Handle OSC 52.
set -g set-clipboard on
# Remove the <Esc> key delay. There are some consequences per
# https://goo.gl/BDcvL3 but they should not be an issue.
set -g escape-time 0
# We do not want arrow keys to repeat when switching between panes.
set -g repeat-time 0
# Set status bar settings. If /root/.hostname exists (such as in a Docker
# container), use that instead of the hostname.
set -g window-status-current-style bg=white
set -g status-style fg=black,bg=cyan
set -g status-interval 1
set -g status-right "#(cat $HOME/.hostname || hostname) (#(echo $USER))"
set -g status-left " %H:%M:%S "
# Pass through Bash title.
set -g set-titles on
set -g set-titles-string "#T"
# Show status line. This is necessary for Google Cloud Shell, where it's turned
# off by default in /etc/tmux.conf.
set -g status on
# Increase escape time. With the default value 0, sometimes escape sequences
# will be visible when using tmux from terminal in VS Code.
set -g escape-time 10
# Open new window and create splits with the same working directory.
bind -T prefix c new-window -c "#{pane_current_path}"
bind -T prefix '"' split-window -c "#{pane_current_path}"
bind -T prefix % split-window -h -c "#{pane_current_path}"
# Define key for entering copy mode. Start cursor at the beginning of the the
# visible area.
bind -T prefix e copy-mode \; send-keys -X top-line
# Define key (same key as Vim) for pasting text.
bind -T prefix o paste-buffer -p
# Define key for editing the visible area in Vim.
bind -T prefix E new-window -d -t 20 "tmux capture-pane -p | vi -" \; run-shell "sleep 0.1" \; select-window -t 20
# Clear all default QWERTY copy mode keys. This makes it easier to refine keys
# for Colemak.
unbind -a -T copy-mode-vi
bind -T copy-mode-vi WheelUpPane { select-pane; send -N 5 -X scroll-up }
bind -T copy-mode-vi WheelDownPane { select-pane; send -N 5 -X scroll-down }
bind -T copy-mode-vi 1 command-prompt -N -I 1 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 2 command-prompt -N -I 2 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 3 command-prompt -N -I 3 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 4 command-prompt -N -I 4 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 5 command-prompt -N -I 5 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 6 command-prompt -N -I 6 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 7 command-prompt -N -I 7 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 8 command-prompt -N -I 8 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi 9 command-prompt -N -I 9 -p (repeat) { send -N "%%" }
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi V send -X select-line
bind -T copy-mode-vi C-v send -X rectangle-toggle \; send -X begin-selection
bind -T copy-mode-vi y send -X other-end
bind -T copy-mode-vi j send -X copy-pipe-and-cancel
bind -T copy-mode-vi Escape send -X clear-selection
bind -T copy-mode-vi q send -X cancel
bind -T copy-mode-vi C-d send -X halfpage-down
bind -T copy-mode-vi C-u send -X halfpage-up
bind -T copy-mode-vi Left send -X cursor-left
bind -T copy-mode-vi Down send -X cursor-down
bind -T copy-mode-vi Up send -X cursor-up
bind -T copy-mode-vi Right send -X cursor-right
bind -T copy-mode-vi h send -X cursor-left
bind -T copy-mode-vi n send -X cursor-down
bind -T copy-mode-vi e send -X cursor-up
bind -T copy-mode-vi i send -X cursor-right
bind -T copy-mode-vi d send -X top-line
bind -T copy-mode-vi D send -X bottom-line
bind -T copy-mode-vi b send -X previous-word
bind -T copy-mode-vi B send -X previous-space
bind -T copy-mode-vi f send -X next-word-end
bind -T copy-mode-vi F send -X next-space-end
bind -T copy-mode-vi w send -X next-word
bind -T copy-mode-vi W send -X next-space
bind -T copy-mode-vi 0 send -X start-of-line
bind -T copy-mode-vi ^ send -X back-to-indentation
bind -T copy-mode-vi \$ send -X end-of-line
bind -T copy-mode-vi g command-prompt -1 -p "(jump to forward)" { send -X jump-to-forward "%%" }
bind -T copy-mode-vi G command-prompt -1 -p "(jump to backward)" { send -X jump-to-backward "%%" }
bind -T copy-mode-vi t command-prompt -1 -p "(jump forward)" { send -X jump-forward "%%" }
bind -T copy-mode-vi T command-prompt -1 -p "(jump backward)" { send -X jump-backward "%%" }
bind -T copy-mode-vi , send -X jump-reverse
bind -T copy-mode-vi \; send -X jump-again
bind -T copy-mode-vi / command-prompt -i -I "#{pane_search_string}" -p "(search down)" { send -X search-forward-incremental "%%%" }
bind -T copy-mode-vi ? command-prompt -i -I "#{pane_search_string}" -p "(search up)" { send -X search-backward-incremental "%%%" }
bind -T copy-mode-vi k send -X search-again
bind -T copy-mode-vi K send -X search-reverse