-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
102 lines (82 loc) · 3.01 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
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @prefix_highlight_prefix_prompt 'Wait'
set -g @prefix_highlight_show_sync_mode 'on'
set -g @prefix_highlight_sync_prompt 'SYNCED'
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
set-option -s escape-time 0
# auto window rename
set-window-option -g automatic-rename
# color, must have same value in bashrc and vimrc, and enable/force truc color
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g mouse on
# Start numbering at 1
set -g base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# don't suspend-client
unbind-key C-z
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
bind-key C-r source-file ~/.tmux.conf\; display-message "Config reloaded..."
# short cut to toggle synchronized panes and update status line
bind e \
set synchronize-panes \;\
refresh-client -S
setw -g mode-keys vi
unbind [
bind Escape copy-mode
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-selection
bind P paste-buffer
# Same screen's shortcut
bind-key A command-prompt 'rename-window %%'
# horizontal split #
bind-key S split-window -v -c "#{pane_current_path}"
bind-key h split-window -v -c "#{pane_current_path}"
# vertical split #
bind-key | split-window -h -c "#{pane_current_path}"
bind-key v split-window -h -c "#{pane_current_path}"
# Resize shorcut
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
# ===================
# === Nested tmux ===
# ===================
# Session is considered to be remote when we ssh into host
if-shell 'test -n "$SSH_CLIENT"' \
'source-file ~/.tmux/tmux.remote.conf; set -g mouse off'
# Also, change some visual styles when window keys are off
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=white,bg=black" \;\
set window-status-current-style "fg=black,bold,bg=white" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
set mouse off \;\
refresh-client -S
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
set -u window-status-current-style \;\
set mouse on \;\
refresh-client -S
# ===================
# === Ending ===
# ===================
if-shell "test -f ~/.tmux/themes/same-as-vim.tmux" "source ~/.tmux/themes/same-as-vim.tmux"
# vim plug doesn't generate functional status-right with prefix_highlight ATM,
# since I don't use it for anything else let's overwrite it. But this is even
# worse as soon as you open vim it will break your status-right
# set -g status-right "#{prefix_highlight}"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'