-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
149 lines (116 loc) · 5.98 KB
/
tmux.conf
File metadata and controls
149 lines (116 loc) · 5.98 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# vim:fileencoding=utf-8:ft=tmux
# Ring the bell if any background window rang a bell
set -g bell-action any
set -g default-shell $SHELL
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal $TERM
bind r source ~/.tmux.conf\; display "~/.tmux.conf sourced!"
# Keep your finger on ctrl, or don't
bind ^D detach-client
# Create splits and vertical splits
bind ^V split-window -h
bind ^S split-window
# Pane resize in all four directions using vi bindings.
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# swap pane with direction
bind C-k if-shell -F '#{?pane_at_top,0,1}' 'swap-pane -U'
bind C-j if-shell -F '#{?pane_at_bottom,0,1}' 'swap-pane -D'
bind C-h if-shell -F '#{?pane_at_left,0,1}' 'swap-pane -d -t left'
bind C-l if-shell -F '#{?pane_at_right,0,1}' 'swap-pane -d -t right'
# Use vi keybindings in copy and choice modes
set -g mode-keys vi
bind -T copy-mode-vi 'v' send -X begin-selection # Begin selection in copy mode.
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle # Begin selection in copy mode.
bind -T copy-mode-vi 'y' send -X copy-pipe 'osc52-yank' # Yank selection in copy mode.
bind -T root 'M-p' run-shell '~/.local/bin/pi-panes'
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
set -g mouse on
set -g allow-passthrough on
set -g extended-keys on
set -g extended-keys-format csi-u
set -g automatic-rename on
set -g automatic-rename-format '#(~/.dotfiles/scripts/tmux-window-name #{pane_pid} #{pane_current_command})'
# set first window to index 1 (not 0) to map more to the keyboard layout...
set -g base-index 1
set -g pane-base-index 1
set -g pane-border-lines heavy
set -g pane-border-format "#{?@pi-session-running, []: #{@pi-session-status} | #{@pi-session-name},}"
set -g pane-border-status bottom
set -g pane-border-indicators both
set -g pane-active-border-style fg=#957fb8,bold
# set -g message-style fg=colour16,bg=colour221,bold
set -g status-bg colour235
set -g status-fg white
set -g status-interval 5
set -g status-left '#[fg=bold] ❐ #S#[default]'
set -g status-left-length 35
set -g window-status-format '#[fg=colour244]#I:#W#[default]'
set -g window-status-current-format '#[fg=bold]#I:#W#[default]'
set -g status-justify absolute-centre
set -g window-status-separator ' '
set -g renumber-windows on
set -g status-right "#{prefix_highlight} #{?@pi-session-running,#[fg=green] ,#[fg=#727169] }#[default]"
# set -g status-justify left
# set -g window-status-separator ' '
# set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour234,nobold]#[default]'
# set -g window-status-format "#[fg=colour235,bg=colour252,bold] #I | #W #[default]"
# set -g window-status-current-format "#[fg=colour234,bg=colour39]#[fg=black,bg=colour39,noreverse,bold] #P-#I | #W #[fg=colour39,bg=colour234,nobold]"
# set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour234,nobold]#[default]'
# set -g status-left-length 35
# set -g status-justify left
# set -g window-status-separator ''
# set -g window-status-format "#[fg=colour234,bg=colour238]#[fg=colour247,bg=colour238,bold] #I #W #[fg=colour238,bg=colour234]#[default]"
# set -g window-status-current-format "#[fg=colour234,bg=colour111]#[fg=grey23,bg=colour111,noreverse,bold] #I #W #[fg=colour111,bg=colour234]#[default]"
# set -g status-right "#{prefix_highlight} #[fg=yellow]#(~/.dotfiles/scripts/tmux-runtime) #[fg=green]#(tmux-mem-cpu-load --colors -a 0 --powerline-right --interval 1) #[fg=green]#[fg=black,bg=green] #{network_bandwidth} #[default]"
# set -g status-left '#[fg=blue] ❐ #S #[default]#'
# set -g status-justify absolute-centre
# set -g window-status-separator " "
# set -g window-status-current-format "#[fg=white]#[fg=default]"
# set -g window-status-format "#[fg=white]#[default]"
# set -g status-right "#{prefix_highlight} #[fg=green]#(tmux-mem-cpu-load --colors -a 0 --powerline-right --interval 1) #[fg=green]#[fg=black, bg=green] #{network_bandwidth} #[default]"
# Screen like binding
unbind C-b
set -g prefix C-a
bind a send-prefix
# Short escape time for vi mode
set -sg escape-time 10
# Local config
if-shell "[ -f ~/.tmux.conf.user ]" 'source ~/.tmux.conf.user'
set -g @tmux-network-bandwidth-padding 1
run-shell "if [ ! -d ~/.tmux/plugins/tpm ]; then git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm; fi"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'thewtex/tmux-mem-cpu-load'
# set -g @plugin 'xamut/tmux-network-bandwidth'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-fpp'
# set -g @plugin 'tmux-plugins/tmux-logging'
run-shell 'if [[ -z $SSH_CLIENT ]]; then tmux set -g @plugin "tmux-plugins/tmux-open"; fi'
# set -g @tmux_window_name_max_name_len "100"
# set -g @tmux_window_name_icon_style "'name_and_icon'"
# set -g @tmux_window_name_dir_programs "['nvim', '/Users/pangxuyuan/.local/share/bob/nightly/bin/nvim', 'vim', 'vi', 'git']"
# set -g @tmux_window_name_substitute_sets "[('.+ipython([32])', 'ipython\g<1>'), ('^(/usr)?/bin/(.+)', '\g<2>'), ('.*/(nvim)', 'nvim'), ('(bash) (.+)/(.+[ $])(.+)', '\g<3>\g<4>'), ('.+poetry shell', 'poetry')]"
# set -g @tmux_window_name_log_level "'DEBUG'"
# set -g @plugin 'ofirgall/tmux-window-name'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# tmux-resurrect
# set -g @resurrect-save S
# set -g @resurrect-restore R
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'