-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
88 lines (68 loc) · 2.67 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
set -g default-terminal "screen-256color"
set -g set-clipboard on
set -g focus-events on
set -g mouse on
# undercurls
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-features ",xterm-256color:RGB"
# Ctrl-s prefix key. Default => C-b. Send C-s with repeat option via C-s C-s
unbind-key C-b
set -g prefix C-s
bind -r C-s send-prefix
bind-key -n c-w send-prefix
bind -n C-k send-keys -R
# open new panes with the cwd
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# window/pane numbering
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g display-panes-time 350
# Keep plenty of history for scrollback
set -g history-limit 10000
# Use emacs / readline key-bindings at the tmux command prompt `<prefix>:`
set -g status-keys emacs
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# activity
setw -g monitor-activity on
set -g visual-activity off
set -g visual-bell on
set -g visual-silence on
# vim-like copy mode bindings
bind-key -T copy-mode-vi v send -X begin-selection
unbind -T copy-mode-vi Enter
unbind -T copy-mode-vi Space
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi Escape send -X cancel
# Smart pane switching with awareness of vim splits
# See this blog post for additional detail:
# http://robots.thoughtbot.com/post/53022241323/seamlessly-navigate-vim-and-tmux-splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Clear
bind C-l send-keys 'C-l'
# Fullscreen a pane
bind-key f resize-pane -Z
# Reload tmux.conf with prefix-r
bind C-r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# bind resizing of panes to H,J,K,L (resizes by steps of 10 lines/columns)
bind -n S-Left resize-pane -L 4
bind -n S-Right resize-pane -R 4
bind -n S-Down resize-pane -D 2
bind -n S-Up resize-pane -U 2
# Toggle input broadcast to all panes
bind -n C-b set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavour 'macchiato'
run '~/.tmux/plugins/tpm/tpm'