-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
114 lines (93 loc) · 3.71 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
# ============================================= #
# Start with defaults from the Sensible plugin #
# --------------------------------------------- #
run-shell ~/.local/share/tmux/sensible.sh
# ============================================= #
set -g default-terminal "screen"
set -g base-index 0
setw -g pane-base-index 0
set -g status-keys vi
set -g mode-keys vi
bind -N "Select pane to the left of the active pane" h select-pane -L
bind -N "Select pane below the active pane" j select-pane -D
bind -N "Select pane above the active pane" k select-pane -U
bind -N "Select pane to the right of the active pane" l select-pane -R
bind -r -N "Resize the pane left by 5" \
H resize-pane -L 5
bind -r -N "Resize the pane down by 5" \
J resize-pane -D 5
bind -r -N "Resize the pane up by 5" \
K resize-pane -U 5
bind -r -N "Resize the pane right by 5" \
L resize-pane -R 5
# rebind main key: C-a
unbind C-b
set -g prefix C-a
bind -N "Send the prefix key through to the application" \
a send-prefix
bind C-a last-window
set -g mouse off
setw -g aggressive-resize on
setw -g clock-mode-style 24
set -s escape-time 0
set -g history-limit 10000
set -g status on
set -g base-index 1
# improve default name of windows
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}: #{b:pane_current_command}'
# passthrough for zen-mode
set-option -g allow-passthrough on
# minimal status bar
set-option -g status-style bg=colour236,fg=colour230
set-option -g status-left ""
set-option -g status-right ""
set -g status-justify centre
set-window-option -g window-status-separator " "
set-window-option -g window-status-current-format "#{?window_zoomed_flag,#[fg=colour214],}x"
set-window-option -g window-status-format "o"
# fix coloring for tmux
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# override suspend
bind-key C-z resize-pane -Z
# popup
bind-key -n C-s if-shell -F '#{==:#{=5:session_name},popup}' 'detach-client' 'run-shell -b ~/.local/bin/tmux-popup.sh'
bind-key -r w run-shell 'tmux choose-tree -wf"##{==:##{session_name},#{session_name}}" -F "##{window_name}"'
# better movement
bind-key -n Pageup copy-mode -u
bind-key -T copy-mode -n Pageup send-keys -X halfpage-up
bind-key -T copy-mode -n Pagedown send-keys -X halfpage-down
bind-key -T copy-mode-vi Pageup send-keys -X halfpage-up
bind-key -T copy-mode-vi Pagedown send-keys -X halfpage-down
# vim like pane movement
bind-key C-h select-pane -t '{left-of}'
bind-key C-l select-pane -t '{right-of}'
bind-key C-k select-pane -t '{up-of}'
bind-key C-n select-pane -t '{down-of}'
# resize with arrow keys
bind-key Right resize-pane -R 5
bind-key Left resize-pane -L 5
bind-key Up resize-pane -U 5
bind-key Down resize-pane -D 5
# Similar split to screen
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
# ensure all window are in same working dir
bind-key a last-window
bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"
# use v to select line and r for rectangle selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# easy scrolling
bind-key -T copy-mode-vi C-p send-keys -X scroll-up
bind-key -T copy-mode-vi C-n send-keys -X scroll-down
bind-key -T copy-mode-vi C-l send-keys -X end-of-line
bind-key -T copy-mode-vi C-h send-keys -X start-of-line
bind-key -T copy-mode-vi j send-keys -X cursor-down
bind-key -T copy-mode-vi k send-keys -X cursor-up
bind-key -T copy-mode-vi h send-keys -X cursor-left
bind-key -T copy-mode-vi l send-keys -X cursor-right
# vim: ft=tmux