-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
57 lines (47 loc) · 1.62 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
if-shell "test -f ~/.tmuxline.sh" "source ~/.tmuxline.sh"
setw -g default-terminal "screen-256color"
setw -g mode-keys vi
unbind %
bind | split-window -h
bind - split-window -v
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -g repeat-time 0
set -g display-time 4000
set -g focus-events on
setw -g aggressive-resize on
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind H resize-pane -L 10
bind J resize-pane -D 10
bind K resize-pane -U 10
bind L resize-pane -R 10
# Credit to https://github.com/samoshkin for nesting
# toggle a little notification on the status bar...
# ==============================================
# === Nesting local and remote sessions ===
# ==============================================
# Session is considered to be remote when we ssh into host
if-shell 'test -n "$SSH_CLIENT"' " \
set -g status-position bottom; \
set -g @copy_backend_remote_tunnel_port 11988"
# We want to have single prefix key "C-a", usable both for local and remote session
# we don't want to "C-a" + "a" approach either
# Idea is to turn off all key bindings and prefix handling on local session,
# so that all keystrokes are passed to inner/remote session
# see: toggle on/off all keybindings · Issue #237 · tmux/tmux - https://github.com/tmux/tmux/issues/237
bind -T root F12 \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
if -F '#{==:#{window_panes},1}' 'set status off' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-right \;\
set -u status \;\
refresh-client -S \;\