-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
executable file
·88 lines (68 loc) · 2.98 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
set -sg escape-time 10
set-option -ga terminal-overrides ",xterm-256color:Tc"
#set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"
# for yazi
set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
#set -g default-terminal "alacritty"
# set-option -ga terminal-overrides ",alacritty:Tc"
#set -g prefix C-q
#bind C-q send-prefix
unbind r
bind r source-file ~/.tmux.conf
# switch panes using Mate-hjkl without arrow
bind h select-pane -L
bind l select-pane -R
bind k select-pane -U
bind j select-pane -D
# resize panes using Mate Capital HJKL
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
# copy
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi V send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind space send-keys 'clear' C-m
bind -n C-space send-keys "clear" C-m
set -g status-position bottom
# v2.1及以上的版本
set-option -g mouse on
set -g mode-keys vi # 开启vi风格后,支持vi的C-d、C-u、hjkl等快捷键
unbind '"'
bind - splitw -v -c '#{pane_current_path}' # 垂直方向新增面板,默认进入当前目录
unbind %
bind = splitw -h -c '#{pane_current_path}' # 水平方向新增面板,默认进入当前目录
set -g base-index 1 # 设置窗口的起始下标为1
set -g pane-base-index 1 # 设置面板的起始下标为1
# tpm 插件工具
set -g status-interval 1
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
set -g @plugin 'tmux-plugins/tmux-logging'
# my config
set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha latte
set -g @catppuccin_window_status_style rounded # basic rounded, slanted, custom, none
set -g @catppuccin_window_text "#W"
set -g @catppuccin_window_current_text "#W"
# Load catppuccin
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
# Make the status line pretty and add some modules
set -g status-right-length 100
set -g status-left-length 100
#set -g status-left "#{E:@catppuccin_status_session}"
set -g status-left "#[bg=#{@thm_green},fg=#{@thm_crust}]#[reverse]#[noreverse] #[fg=#{@thm_mantle}]#S #[bg=#{@thm_green},fg=#{@thm_crust}]#[reverse] "
# custom memory useage percent
set -g status-right "#[bg=#{@thm_flamingo},fg=#{@thm_crust}]#[reverse]#[noreverse] "
#set -ag status-right "#[fg=#{@thm_fg},bg=#{E:@catppuccin_status_module_text_bg}] #(free -m | sed -n '2p' | awk '{print $3/$2*100}')% "
set -ag status-right "#[fg=#{@thm_fg},bg=#{E:@catppuccin_status_module_text_bg}] #(~/.config/tmux/custom/mem_usage.sh) "
set -agF status-right "#{E:@catppuccin_status_cpu}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'