-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
65 lines (50 loc) · 2.06 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
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
set -g @catppuccin_flavour 'macchiato'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'fcsonline/tmux-thumbs'
run '~/.tmux/plugins/tpm/tpm'
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Smart Colemak pane navigation 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|l?n?vim?x?)(diff)?$'"
bind-key 'n' if-shell "$is_vim" 'send-keys C-w n' 'select-pane -L'
bind-key 'e' if-shell "$is_vim" 'send-keys C-w e' 'select-pane -D'
bind-key 'i' if-shell "$is_vim" 'send-keys C-w i' 'select-pane -U'
bind-key 'o' if-shell "$is_vim" 'send-keys C-w o' '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 -T copy-mode-vi 'C-n' select-pane -L
bind-key -T copy-mode-vi 'C-e' select-pane -D
bind-key -T copy-mode-vi 'C-i' select-pane -U
bind-key -T copy-mode-vi 'C-o' select-pane -R
# Colemak window navigation
bind N previous-window
bind O next-window
# Split from the current pane
bind v split-window -v -c "#{pane_current_path}"
bind h split-window -h -c "#{pane_current_path}"
# reorg panes
bind r next-layout
# Keep indices under control
set-option -g renumber-windows on
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
set -g @thumbs-alphabet colemak-homerow
unbind-key -n C-l
unbind-key -n C-h
unbind-key -n C-j
unbind-key -n C-k