-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
63 lines (50 loc) Β· 2.31 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
# TODO: Enhance UI using: β β β
# Set status bar at the top of the terminal
set-option -g status-position top
# Define colors similar to nvim lualine config
set-option -g status-bg "#3c3836"
set-option -g status-fg "#ebdbb2"
# Set active window title colors (mode base and mode n)
setw -g window-status-current-style "bg=#3c3836,fg=#ebdbb2"
setw -g window-status-current-format "#[fg=#458588] #I: #W"
# Inactive window title colors (middle part)
setw -g window-status-style "bg=#3c3836,fg=#a89984"
setw -g window-status-format "#[fg=#ebdbb2,bg=#3c3836] #I: #W"
# Customize left side of the status bar (session name)
set-option -g status-left-length 50
set-option -g status-left "#[fg=#3c3836,bg=#458588] #S #[fg=#ebdbb2,bg=#3c3836]"
# Customize right side of the status bar
set-option -g status-right-length 150
set-option -g status-right " #[fg=#3c3836,bg=#458588] %H:%M "
# Pane border colors
set-option -g pane-border-style "fg=#3c3836"
set-option -g pane-active-border-style "fg=#458588"
# Message
set-option -g message-style "bg=#1d2021,fg=#ebdbb2"
# Mode indicator
setw -g mode-style "bg=#458588,fg=#3c3836"
# Enable vim motions
set-window-option -g mode-keys vi
# Start with pane 1
set -g pane-base-index 1
# Remap C-b to C-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Smart pane switching with awareness of Vim splits.
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