-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
114 lines (88 loc) · 3.56 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
## general settings
set -g @continuum-save-interval '5'
if-shell "test -f /bin/zsh" "set -g default-command /bin/zsh"
set -g mouse on
set -g default-terminal "xterm-kitty"
setenv -g COLORTERM truecolor
set -g base-index 1
setw -g pane-base-index 1
setw -g monitor-activity on
set -g visual-activity off
set -g set-titles on
set -g set-titles-string "#S: #W#{?$SSH_CLIENT, (#h),}"
set -g @yank_action 'copy-pipe'
# window indices
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# session indices, resurrect on startup
set-hook -g session-created "run $HOME/Util/tmux_startup.sh\; run $HOME/Util/renumber_tmux_sessions.sh"
set-hook -g session-closed "run $HOME/Util/renumber_tmux_sessions.sh"
# toggle temporary session
bind t set-option destroy-unattached
# reset a pane
bind S respawn-pane -k \; clear-history
## vim bindings
set -g mode-keys vi
unbind p
bind p paste-buffer -p
bind Escape copy-mode
bind-key -T copy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
bind-key -T copy-mode-vi 'd' send -X halfpage-down
bind-key -T copy-mode-vi 'u' send -X halfpage-up
# 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|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"
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
# colors
highlight_bg="cyan"
highlight_fg="black"
muted_text_bg="black"
text_bg="brightblack"
text_fg="white"
active_bg="yellow"
# status line
set -g status-left "#[fg=#{text_fg},bg=#{text_bg}] #S#{?#{==:#{E:destroy-unattached},on},*,} #[fg=#{text_fg},bg=#{muted_text_bg}] "
set -g status-left-length 20
set -g status-right " #[fg=#{text_fg},bg=#{text_bg}] #(whoami)@#h #(gitmux -cfg ~/.gitmux.conf '#{pane_current_path}')"
set -g status-right-length 75
set -g status-interval 1
# status colors
set -g status-bg $muted_text_bg
set -g status-fg $text_fg
# window list
setw -g window-status-format "#[fg=#{text_fg},bg=#{text_bg},bold] #I #[nobold]#W "
# active window
setw -g window-status-current-format "#[fg=#{highlight_fg},bg=#{highlight_bg},bold] #I #[nobold]#W #{?window_zoomed_flag,Z ,}"
setw -g window-status-separator ""
# window activity
setw -g window-status-activity-style bg=$active_bg
# panes
set -g pane-border-style fg=$muted_text_bg
set -g pane-active-border-style fg=$highlight_bg
set -g display-panes-colour $muted_text_bg
set -g display-panes-active-colour $text_bg
# command/message line
set -g message-style bg=$highlight_bg,fg=$highlight_fg
set -g message-command-style bg=$text_bg,fg=$highlight_bg
# make the window list appear at the left-hand side instead of at the center
set -g status-justify left
# add plugins
run-shell ~/.tmux/plugins/tmux-sensible/sensible.tmux
run-shell ~/.tmux/plugins/tmux-pain-control/pain_control.tmux
run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
run-shell ~/.tmux/plugins/tmux-continuum/continuum.tmux
run-shell ~/.tmux/plugins/tmux-open/open.tmux
run-shell ~/.tmux/plugins/tmux-yank/yank.tmux
unbind-key -T copy-mode-vi MouseDragEnd1Pane