-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
124 lines (97 loc) · 4.89 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
117
118
119
120
121
122
123
124
# =============
# === Basic ===
# =============
set-option -sg escape-time 0
set-window-option -g mode-keys vi
set-option -g renumber-windows on
set-option -g display-panes-time 4000
set-option -g default-terminal "screen-256color"
set-option -ag terminal-overrides ",xterm-256color:RGB"
set-option -g mouse on
set-option -gq allow-passthrough on
# ==============
# === Keymap ===
# ==============
# Keys can be set.
# a b [e] [g] [h] [j] [k] [l] [u] [v] y
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
bind-key C-r source-file ~/.tmux.conf \; display "Refreshed tmux configure."
bind-key C-g set -g status
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-j swap-pane -D
bind-key -r C-k swap-pane -U
bind-key -r < resize-pane -L 5
bind-key -r - resize-pane -D 5
bind-key -r = resize-pane -U 5
bind-key -r > resize-pane -R 5
bind-key c new-window -c "#{pane_current_path}"
bind-key g new-window -c "#{pane_current_path}" -a
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
bind-key u command-prompt "join-pane -t :'%%' -h"
# bind-key C-m command-prompt "move-window -t :'%%'"
# bind-key C-s command-prompt "run-shell '~/.scripts/tmux/rename_window.sh %%'"
bind-key C-s command-prompt "swap-window -d -t :'%%'"
bind-key C-e command-prompt -p "New pane title:" 'select-pane -T "%%"'
bind-key e command-prompt "select-pane -t '%%'"
bind-key C-w last-window
bind-key C-p last-pane
bind-key x confirm-before -p "Kill pane '#P'? (y/n)" kill-pane
bind-key C-x confirm-before -p "Kill window '#W'? (y/n)" kill-window
bind-key -T copy-mode-vi v send -X rectangle-off \; send -X begin-selection
bind-key -T copy-mode-vi C-v send -X rectangle-on \; send -X begin-selection
# For Linux: `sudo apt-get install xsel`
# For MacOS: `brew install reattach-to-user-namespace`
if-shell "uname | grep -q Darwin" "set-option -g default-command 'reattach-to-user-namespace -l $SHELL'"
bind -T copy-mode-vi y send -X copy-pipe-and-cancel \
"command -v pbcopy >/dev/null && pbcopy \
|| command -v xsel >/dev/null && xsel --input --clipboard \
|| command -v xclip >/dev/null && xclip -in -selection clipboard"
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel \
"command -v pbcopy >/dev/null && pbcopy \
|| command -v xsel >/dev/null && xsel --input --clipboard \
|| command -v xclip >/dev/null && xclip -in -selection clipboard"
# ===================
# === Colorscheme ===
# ===================
# set-option -g window-status-current-style "fg=green,bg=black,bold"
# set-option -g window-status-separator "|"
# set-option -g pane-border-format "#{pane_index} #T"
# set-option -g status-left "| #S |"
set-option -g status-interval 1
set-option -g clock-mode-style 24
set-option -g status-left-length 100
set-option -g status-right-length 100
set-option -g pane-active-border-style "fg=#938aa9"
set-option -g pane-border-style "fg=#1e1e2e"
set-option -g message-style "bg=#1e1e2e,fg=#dcd7ba"
set-option -g status-style "bg=default,fg=#dcd7ba"
set-option -g status-left "#[bg=#938aa9,fg=#1e1e2e]#{?client_prefix,#[bg=#ffa066],} #S "
set-option -g status-right ""
# # set-option -ga status-right "#[fg=#1e1e2e,bg=#d27e99] #(bash ~/.tmux/_/cpu_info.sh) "
# # set-option -ga status-right "#[fg=#1e1e2e,bg=#dca561] #(bash ~/.tmux/_/ram_info.sh) "
# set-option -ga status-right "#{?#{==:#(bash ~/.tmux/_/network_bandwidth.sh),},,#[fg=#1e1e2e,bg=#d27e99] #(bash ~/.tmux/_/network_bandwidth.sh) }"
# set-option -ga status-right "#{?#{==:#(bash ~/.tmux/_/cpu_info.sh),},,#[fg=#1e1e2e,bg=#dca561] #(bash ~/.tmux/_/cpu_info.sh) }"
# set-option -ga status-right "#{?#{==:#(bash ~/.tmux/_/ram_info.sh),},,#[fg=#1e1e2e,bg=#938aa9] #(bash ~/.tmux/_/ram_info.sh) }"
# # set-option -ga status-right "#[fg=#1e1e2e,bg=#6a9589] %F %a %T "
# set-window-option -g window-status-current-format "#[fg=#dcd7ba,bg=#54546d] #I #W#{?window_flags,#[fg=#938aa9]#{window_flags},} "
set-window-option -g window-status-current-format "#[fg=#dcd7ba,bg=#54546d] #I #W#F "
# set-window-option -g window-status-format "#[fg=#dcd7ba]#[bg=default] #I #W#{?window_flags,#[fg=#54546d]#{window_flags},}"
set-window-option -g window-status-format "#[fg=#dcd7ba]#[bg=default] #I #W#F"
set-window-option -g window-status-activity-style "bold"
set-window-option -g window-status-bell-style "bold"
set-option -g mode-style "fg=#1e1e2e,bg=#ffa066"
# # ===========
# # === TPM ===
# # ===========
# NOTE: Disable tpm beacuse of the default-command problem in MacOS: `set-option -g default-command "/bin/zsh -l"`
# run-shell "if [ ! -d ~/.tmux/plugins/tpm ]; then git clone git@github.com:tmux-plugins/tpm.git ~/.tmux/plugins/tpm; fi"
# set-option -g @plugin "tmux-plugins/tpm"
# set-option -g @plugin "tmux-plugins/tmux-sensible"
# # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# run-shell "bash ~/.tmux/plugins/tpm/tpm"