-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
73 lines (58 loc) · 2.04 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
## tmux plugin
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
## Status bar
# set left content
set-option -g status-left '[#H / #P / #S] '
set-option -g status-left-length 100
# set right content
set-option -g status-right '#{cpu_icon}#{cpu_percentage} #{get_ssid} #{online_status} #{battery_icon}#{battery_percentage} [ %Y-%m-%d (%a) %H:%M:%S ] '
set-option -g status-right-length 350
# enable utf-8
set-option -g status-utf8 on
# update interval
set-option -g status-interval 5
# set window num center position
set-option -g status-justify centre
# set posision
set -g status-position top
## Key bind
# move pain vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# set synchronize-panes
bind -r e setw synchronize-panes on
bind -r E setw synchronize-panes off
# resize pain
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# spit window
bind | split-window -h
bind - split-window -v
# update config
bind r source-file ~/.tmux.conf \; display-message "reload config"
# enable mouse pain
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
## Copy
# enable copy use vim bind
set-window-option -g mode-keys vi
bind-key v copy-mode \; display "copy mode"
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key p paste-buffer
# vim <-> tmux
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'