-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
152 lines (110 loc) · 4.98 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
###########################
# Configuration
###########################
# Place the status bar at top
set-option -g status-position top
# Change default key binding to Ctrl + A
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Focus last window
bind-key -T prefix a last-window
# Toggle status bar
bind-key -T prefix t set-option -g status
# Equally resize all panes
bind-key = select-layout even-horizontal
# Reload config
bind R source-file ~/.tmux.conf
set-option -g default-shell /opt/homebrew/bin/fish
set-option -g default-terminal "tmux-256color"
set-option -ga terminal-overrides ",*256col*:Tc" # true colous support
# Undercurl support
# http://evantravers.com/articles/2021/02/05/curly-underlines-in-kitty-tmux-neovim/
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind \\ split-window -h -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -c "#{pane_current_path}"
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# rerun the last command in last pane
bind r send-keys -t ! C-l Up Enter
# start window index at 1
set-option -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# highlight window when it has new activity
# setw -g monitor-activity on
# set-option -g visual-activity on
set-option -g mode-keys vi
set-option -g status-keys emacs
# re-number windows when one is closed
set-option -g renumber-windows on
# don't rename windows automatically
set-option -g allow-rename off
# Set title
set-option -g set-titles on
set-option -g set-titles-string "#T"
set-option -g history-limit 30000
# tmux messages are displayed for 4 seconds
set-option -g display-time 4000
# set refresh interval for status bar
set-option -g status-interval 15
# focus events enabled for terminals that support them
set-option -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup - source https://github.com/tmux-plugins/tmux-sensible/blob/master/sensible.tmux#L122
set-window-option -g aggressive-resize on
# Mouse options
set-option -g mouse on
# Fix scrolling
set-option -ga terminal-overrides ',xterm*:smcup@:rmcup@'
set-option -g bell-action none
bind C-l send-keys 'C-l'
########################
# Theme
########################
# load the theme colors
source ~/.tmux/theme.tmux
set-option -g status-style bg="#{@thm_bg_tinted}"
# set-option -g status-left "#[fg=#{@thm_fg_darker},bg=@{#thm_bg},bold] #S "
set-option -g status-left ""
set-option -g status-right "#[fg=#{@thm_active}]#{?window_zoomed_flag, ,} #{prefix_highlight} #[fg=#{@thm_time_fg},bg=#{@thm_time_bg},bold] %Y-%m-%d %H:%M "
set-option -g window-status-format "#[bg=#{@thm_bg_tinted},fg=#{@thm_inactive}] #I #W "
# set-option -g window-status-current-format "#[fg=#{@thm_bg},bg=#{@thm_active}] #I #W "
set-option -g window-status-current-format "#[bg=#{@thm_bg_tinted},fg=#{@thm_active}] #I #W "
set-option -g @prefix_highlight_bg "#{@thm_bg_tinted}"
set-option -g @prefix_highlight_fg "#{@thm_indicator}"
set-option -g @prefix_highlight_copy_mode_attr "bg=#{@thm_bg},fg=#{@thm_indicator}"
set-option -g @prefix_highlight_prefix_prompt ''
set-option -g @prefix_highlight_show_copy_mode 'on'
set-option -g @prefix_highlight_copy_prompt ''
# set-option -g @prefix_highlight_output_prefix ''
# set-option -g @prefix_highlight_output_suffix ' '
#########################
# Plugins
#########################
# 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 -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 -g @plugin 'tmux-plugins/tpm'
# set-option -g @plugin 'tmux-plugins/tmux-sensible'
# set-option -g @plugin 'tmux-plugins/tmux-yank'
# set-option -g @plugin 'christoomey/vim-tmux-navigator'
# set-option -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
set-option -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# Install `tpm` if needed.
if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'