-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_tmux.conf
70 lines (53 loc) · 2.78 KB
/
dot_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
# List of plugins.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavour 'macchiato' # latte, frappe, macchiato or mocha
set -g @catppuccin_window_status_enable "yes"
set -g @catppuccin_window_status_icon_enable "no"
set -g @catppuccin_status_modules_right "session"
# Set text of tabs (tmux windows) and active tabs to the application.
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_text "#W"
# Use C-s as the prefix key. The default (C-b) is not ergonomic and is useful in
# vim.
unbind C-b
set -g prefix C-s
# Reload configuration.
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Use same key bindings for splitting windows as in nvim (Telescope, nvim-tree).
# Also, use the current path for the new panes.
bind-key C-x split-window -v -c '#{pane_current_path}'
bind-key C-v split-window -h -c '#{pane_current_path}'
# Start windows and panes index at 1, not 0.
set -g base-index 1
setw -g pane-base-index 1
# Ensure window index numbers get reordered on delete.
set-option -g renumber-windows on
# Pane navigation used in combination with tmux.nvim.
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' }
bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L'
bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D'
bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U'
bind-key -T copy-mode-vi 'C-l' if -F '#{pane_at_right}' '' 'select-pane -R'
# Move status bar to the top.
set-option -g status-position top
# Open popup with sessionizer
bind-key C-f display-popup -T " sessionizer " -E "tmux-sessionizer"
bind-key C-g display-popup -T " lazygit " -w "90%" -h "90%" -E "lazygit"
# Enable mouse support
set -g mouse on
# Use vi key bindings in copy mode.
setw -g mode-keys vi
# Vim like shortcuts to enter copy-mode, begin selection and copy.
bind-key y copy-mode
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Install TMUX plugin manager automatically.
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.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'