-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
117 lines (96 loc) · 4.68 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
set -g @plugin 'tmux-plugins/tmux-resurrect'
bind '\' split-window -h -c "#{pane_current_path}"
bind h resize-pane -L 10
bind j resize-pane -D 5
bind k resize-pane -U 5
bind l resize-pane -R 10
bind K kill-window
bind B select-pane -t 1 \; send-keys Up C-m \; select-pane -t 0
# bind S display-popup -E "tmux new-session -A -s scratch"
bind S split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
bind f split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
set -g mouse on
set -g base-index 1
set -g renumber-windows on
setw -g mode-keys vi
set -sg escape-time 0
set-option -g allow-rename on
# set -g default-terminal "screen-256color"
# set -g default-terminal "tmux-256color"
# set -g default-terminal "alacritty"
# set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
bind M switch-client -t '~'
#Copy and paste to system clipboard
if-shell "uname | grep -q Darwin" {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
} {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
}
# source and reload tmux config
bind r source-file ~/.tmux.conf
#Initialize tmux plugin manager (tpm)
run '~/.tmux/plugins/tpm/tpm'
# ----------------------------=== Theme ===--------------------------
# status
set -g status-position top
set -g status "on"
set -g status-bg "${thm_nordbg}"
set -g status-justify "left"
set -g status-left-length "100"
set -g status-right-length "100"
# statusline
# set -g status-bg black
# set -g status-fg white
# set -g status-right "#[bg=magenta]#[fg=black] #S "
set -g status-left "#[bg=${thm_nord_darkerbg}]#[fg=${thm_nordfg}] #S "
# set -g window-status-separator " "
# set -g window-status-current-format "#[fg=black]#[bg=green] #W "
# set -g window-status-format " #W "
set -g status-justify centre
# set -g window-status-current-format "●"
# set -g window-status-format "○"
set -g window-status-format "#[fg=brightblack,bg=default](#[fg=white,bg=default]#I ○ #W#[fg=brightblack,bg=default])"
set -g window-status-current-format "#[fg=brightblack,bg=default](#[fg=${thm_nordfg},bold,bg=default]#I ● #W#[fg=brightblack,nobold,bg=default])"
set -g status-right '#(gitmux "#{pane_current_path}")'
# set -g status-right ""
# if-shell "uname | grep -q Darwin" "set -g status-right '#[fg=white,bold,bg=default]%l:%M %a, %b %d '"
# if-shell "uname | grep -q Darwin" "set -ga status-right '#[fg=black,bold,bg=${thm_magenta}] 🐮 '"
# messages
set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre"
set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre"
# panes
set -g pane-border-style fg="${thm_gray}"
set -g pane-active-border-style fg="${thm_blue}"
# windows
setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_nordbg}",none
setw -g window-status-separator ""
setw -g window-status-style fg="${thm_fg}",bg="${thm_nordbg}",none
# --------=== Statusline
#Tmux Navigator
## Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# decide whether we're in a Vim process
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(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 -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+'
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
bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+