-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_tmux.conf
More file actions
100 lines (81 loc) · 3.48 KB
/
dot_tmux.conf
File metadata and controls
100 lines (81 loc) · 3.48 KB
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
# inherit venv/uv/python virtual environments
# set -g update-environment " VIRTUAL_ENV PATH PYTHONHOME"
# --------------------------------
# Fundamentals
# Allows home key, truecolors, etc
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm*:Tc:smcup@:rmcup@"
set -ag terminal-overrides ",*256col*:Tc"
# Enable passthrough of escape sequences
set -g allow-passthrough on
# Enable images
# set -gq allow-passthrough on
set -g visual-activity off
# Performance
set -sg escape-time 0
set -g history-limit 50000
# Mouse support (scroll + drag-to-copy)
set -g mouse on
# --------------------------------
# Binds
# Use CSI-u sequences as they're the most up-to-date and best supported
set -gq extended-keys always
set -gq extended-keys-format csi-u
set -as terminal-features 'xterm*:extkeys'
# Pre 3.5:
# bind S-Enter send-keys "\n"
# bind S-Enter send-keys "^[[27;2;13~"
# bind S-Enter send-keys "^[[13:;2u~"
# (ignored post-3.5, from there onwards it's solely CSI-u)
# Prefix shortcut is ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Alternate prefix on F6
set -g prefix2 F6
bind F6 send-prefix -2
# F7 cycles through panes
bind -n F7 select-pane -t :.+
# F8/F9 for previous/next window
bind -n F8 previous-window
bind -n F9 next-window
set -wg mode-keys vi
bind \\ split-window -h # Split panes horizontal
bind - split-window -v # Split panes vertically
# 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|l?n?vim?x?|fzf)(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 -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
# https://github.com/neovim/neovim/wiki/FAQ#esc-in-tmux-or-gnu-screen-is-delayed
# https://github.com/helix-editor/helix/wiki/Troubleshooting#when-using-tmux-or-screen-there-is-a-delay-after-hitting-escape-before-its-registered
set -sg escape-time 10
# Clipboard: OSC 52 via direct write to client TTY (works over SSH and mosh)
set -g set-clipboard on
bind -T copy-mode-vi Enter send-keys -X copy-selection-and-cancel
# Force OSC 52 to use 'c;' selection parameter (required for mosh compatibility)
set -ag terminal-overrides ",*:Ms=\\E]52;c%p1%.0s;%p2%s\\7"
# --------------------------------
# Theming
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato or mocha
set -g @catppuccin_window_status_style "basic"
# set -g status-left ""
# set -g status-right ""
#
# set -ag status-right "#[bg=#{@thm_yellow},fg=#{@thm_crust}]#[reverse]#[noreverse] "
# set -ag status-right "#[fg=#{@thm_fg},bg=#{@thm_mantle}] #(top -bn1 | grep \"Cpu(s)\" | awk '{printf \"%04.1f%%%\", 99.9 - $8 }') "
#
# set -ag status-right "#[bg=#{@thm_flamingo},fg=#{@thm_crust}]#[reverse]#[noreverse] "
# set -ag status-right "#[fg=#{@thm_fg},bg=#{@thm_mantle}] #(free -h | awk '/Mem:/ {printf \"%04.1f/%04.1fGi\", $3, $2}') "
#
# # set -ag status-right "#{E:@catppuccin_status_application}"
# set -ag status-right "#{E:@catppuccin_status_session}"
# set -ag status-right "#{E:@catppuccin_status_uptime}"