From b4d162f8ff3ce8d67d0eedcf09eecc3631a45363 Mon Sep 17 00:00:00 2001 From: kody Date: Mon, 15 Dec 2025 10:58:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(tmux):=20=E6=B7=BB=E5=8A=A0=20tmux=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmux/tmux.conf | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tmux/tmux.conf diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..56061d8 --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,50 @@ +# 启用鼠标支持 +set -g mouse on + +# 终端颜色适配 +set -g default-terminal "screen-256color" +set -ga terminal-overrides ',xterm-256color:RGB' + +# 窗格/窗口索引从 1 开始 +set -g base-index 1 +set -g pane-base-index 1 + +# 关闭 tmux 时不自动终止会话 +set -g detach-on-destroy off + +# 分屏快捷键 +bind | split-window -h # 前缀键 + | :水平分屏(左右) +bind - split-window -v # 前缀键 + - :垂直分屏(上下) + +# 窗格切换 +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# 调整窗格大小 +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# 窗口操作快捷键 +bind c new-window -n "new" +bind x kill-pane +bind & kill-window +bind r source-file ~/.tmux.conf \; display-message "Tmux config reloaded!" + +# 会话操作 +bind s choose-tree + +# 开启复制模式快捷键 +bind -T copy-mode-vi v send-keys -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel +bind p paste-buffer + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'dracula/tmux' + +run '~/.tmux/plugins/tpm/tpm'