-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
143 lines (106 loc) · 4.54 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
unbind C-b
set -g prefix C-a
bind C-a last-window
set -g base-index 1
set -g pane-base-index 1
# set-option -g history-limit 10000
# Do start a login shell because MacOS does weird things in /etc/zprofile
set-option -g default-command "${SHELL} -l"
# true colours support
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides ",xterm-256color:Tc"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
# underscore colours - needs tmux-3.0
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# Fix nvim redraw issues
set -as terminal-overrides ',*:indn@'
# Allow toggling the status bar
set -g status on
bind t set status
# Automatically renumber windows as they are closed
set-option -g renumber-windows on
# Do not automatically rename windows
set-option -g allow-rename off
# Fix the escape key delay
set -sg escape-time 0
setw -g mode-keys vi
setw -g mouse off
# Swap windows left and right
bind -n C-S-Left swap-window -t -1\; select-window -t -1
bind -n C-S-Right swap-window -t +1\; select-window -t +1
# Pane resizing
bind -r h resize-pane -L 5
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
# Set pwd to current pane's path
bind C-c attach -c "#{pane_current_path}"
# Remove current window name from rename-window prompt
bind , command-prompt "rename-window '%%'"
# Pane joining
# bind S choose-window "join-pane -v -s '%%'"
bind v choose-window "join-pane -h -s '%%'"
# Window cycling
bind -r n next-window
bind -r p previous-window
# Window swapping
bind S choose-tree -O name -w "swap-window -t '%%'"
bind s choose-tree -O name -s "switch-client -t '%%'"
# Clear the screen with <prefix>C-l
bind C-l send-keys 'C-l'
# Status bar on bottom
# set-option -g status-position top
# default statusbar colors
set-option -g status-style fg=white,bg=black,default
# default window title colors
set-window-option -g window-status-style fg=white,bg=default,dim
# active window title colors
set-window-option -g window-status-current-style fg=cyan,bg=default,dim
# command/message line colors
set-option -g message-style fg=white,bg=black,bright
# # Refresh the status bar every 30 seconds.
set-option -g status-interval 30
# The status bar itself.
set -g status-justify centre
set -g status-left-length 40
set -g status-left "#[bg=black]#{session_name} #{=22:pane_title}"
# set -g status-right "#(cat /tmp/gtd) #[fg=white]%d %b %R"
# set -g status-right ""
set-option -g display-time 1000
# Reload source file
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
# Fix cursors in tmux
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# '@pane-is-vim' is a pane-local option that is set by the plugin on load,
# and unset when Neovim exits or suspends; note that this means you'll probably
# not want to lazy-load smart-splits.nvim, as the variable won't be set until
# the plugin is loaded
# Smart pane switching with awareness of Neovim splits.
bind-key -n C-h if -F "#{@pane-is-vim}" 'send-keys C-h' 'select-pane -L'
bind-key -n C-j if -F "#{@pane-is-vim}" 'send-keys C-j' 'select-pane -D'
bind-key -n C-k if -F "#{@pane-is-vim}" 'send-keys C-k' 'select-pane -U'
bind-key -n C-l if -F "#{@pane-is-vim}" 'send-keys C-l' 'select-pane -R'
# Smart pane resizing with awareness of Neovim splits.
bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' 'resize-pane -L 3'
bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' 'resize-pane -D 3'
bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' 'resize-pane -U 3'
bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' 'resize-pane -R 3'
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 -F \"#{@pane-is-vim}\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if -F \"#{@pane-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
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
source-file ~/dev/build/tokyonight.nvim/extras/tmux/tokyonight_night.tmux
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# vim: ft=tmux