-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
111 lines (84 loc) · 4.08 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
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins │
# ╰──────────────────────────────────────────────────────────╯
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
run '~/.tmux/plugins/tpm/tpm'
# Themes
set-option -g status-position top
set -g status-bg '#1e1e2e'
set -g status-fg '#cdd6f4'
set-option -g status-left ' '
set-option -g status-left-length 0
set -g @host_short "#(echo #{host} | cut -d'.' -f1)"
set -g status-right '#{cpu_fg_color} #{cpu_percentage} #{ram_fg_color} #{ram_percentage} #{gpu_fg_color} #{gpu_percentage}#[default] - #{host_short}'
set -g pane-border-style 'fg=#45475a'
set -g pane-active-border-style 'fg=#f9e2af'
set -g window-status-style 'fg=#585b70'
set -g window-status-current-style 'fg=#f9e2af'
set -g window-status-format '#I:#W#{?window_zoomed_flag, , }'
set -g window-status-current-format '#I:#W#{?window_zoomed_flag, , }'
# ╭──────────────────────────────────────────────────────────╮
# │ Options │
# ╰──────────────────────────────────────────────────────────╯
# Set true color
set-option -sa terminal-overrides ",xterm*:Tc"
set-option -sa terminal-features ',xterm-kitty:RGB'
set -g mouse on
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
set-window-option -g mode-keys vi
set-option -g allow-rename on
set -sg escape-time 0 # more fluent escape key
set -sg repeat-time 0 # more responsive pane switching
# yazi
set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
# ╭──────────────────────────────────────────────────────────╮
# │ Keybindings │
# ╰──────────────────────────────────────────────────────────╯
# Set prefix
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Shift Alt vim keys to switch windows
# bind -n M-H previous-window
# bind -n M-L next-window
# bind -n M-S choose-tree -Zs
# bind -n M-W choose-tree
bind -n M-O next-layout
# Visual mode
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
# Open panes in current directory
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Open new window in current directory
# bind c new-window -c "#{pane_current_path}"
bind c new-window -c ~
# Resize panes
bind -n S-Up resize-pane -U 5
bind -n S-Down resize-pane -D 5
bind -n S-Left resize-pane -L 5
bind -n S-Right resize-pane -R 5
# Clear scrollback buffer
bind K send-keys "clear"\; send-keys "Enter"\; clear-history
# Reload tmux.conf
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
bind s choose-tree -swZ
bind w choose-tree -wZ
bind -n M-S-Left swap-window -t -1\; select-window -t -1
bind -n M-S-Right swap-window -t +1\; select-window -t +1
# go to last prompt
bind-key b copy-mode\;\
send-keys -X start-of-line\;\
send-keys -X search-backward "❯"
run-shell ~/.tmux/plugins/tmux-cpu/cpu.tmux