-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
100 lines (85 loc) · 4.13 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
set-environment -g PATH "/usr/local/bin:/bin:/usr/bin:/usr/sbin:/opt/homebrew/bin"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Enable mouse
set -g mouse on
# Highlight the current window
setw -g window-status-current-style bg=colour0,fg=colour11,dim
# Reload config file
bind r source-file ~/.tmux.conf
# Key bindings
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# Status bar
# set -g status on
# set -g status-position bottom
# set -g status-style "fg=#aeafb0,bg=#292e42"
# set -g status-justify left
# set -g status-left-length 200
# set -g status-right-length 200
# set -g status-left ''
# set -g status-right '#[fg=#1a1b26,bg=#ff9e64,bold] %a #[fg=#1a1b26,bg=#ff9e64] %Y-%m-%d %H:%M '
# set -g window-status-separator ''
# set -g window-status-style "NONE,fg=#458588,bg=#131a24"
# set -g window-status-current-style "fg=#db4b4b,bg=#292e42,bright,nobold"
# set -g window-status-current-format "#[fg=#db4b4b,bg=#292e42,bright,bold] #I #W "
# set -g window-status-format "#[fg=#a9b1d6,bg=#292e42,bright,nobold] #I #W "
# set -g display-panes-active-colour colour33
# set -g display-panes-colour colour167
# set -g set-titles on
# set -g set-titles-string "#T"
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#a89984,bg=#504945"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#a89984"
set -g status-position "bottom"
set -g status-style "none,bg=#3c3836"
set -g message-style "fg=#a89984,bg=#504945"
set -g pane-border-style "fg=#504945"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "underscore,fg=#a89984,bg=#3c3836"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#a89984,bg=#3c3836"
set -g status-left "#[fg=#1d2021,bg=#a89984] #S #[fg=#a89984,bg=#3c3836,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#a89984,bg=#504945] DuyAn #[fg=#3c3836,bg=#3c3836,nobold,nounderscore,noitalics]#[fg=#a89984,bg=#3c3836] %a #[fg=#504945,bg=#3c3836,nobold,nounderscore,noitalics]#[fg=#a89984,bg=#504945] %Y-%m-%d %H:%M"
setw -g window-status-format "#[fg=#3c3836,bg=#3c3836,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#3c3836,bg=#3c3836,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#3c3836,bg=#504945,nobold,nounderscore,noitalics]#[fg=#a89984,bg=#504945] #I #W #[fg=#504945,bg=#3c3836,nobold,nounderscore,noitalics]"
set -g pane-border-status off
# set -g default-terminal "screen-256color"
# set -sa terminal-features ',screen-256colo::RGB'
# set -ga terminal-overrides ",screen-256color:Tc"
set -g default-terminal "tmux-256color"
set -sg escape-time 10
set -g focus-events on
set -g default-shell /opt/homebrew/bin/fish
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'pbcopy'