Compare commits

...

4 Commits

4 changed files with 50 additions and 3 deletions

2
.chezmoiignore Normal file
View File

@@ -0,0 +1,2 @@
# 各类程序生成的日志,不纳入 dotfiles 管理
**/*.log

View File

@@ -33,6 +33,10 @@ if status is-interactive
type -q btop; and abbr top btop
type -q tldr; and abbr help tldr
type -q chezmoi; and abbr cz chezmoi
type -q tmux; and abbr tm tmux
type -q tmux; and abbr tmn 'tmux new'
type -q tmux; and abbr tma 'tmux attach'
type -q tmux; and abbr tml 'tmux list-sessions'
# ========= thefuck自动命令纠错 =========
type -q thefuck; and thefuck --alias | source

41
dot_config/tmux/tmux.conf Normal file
View File

@@ -0,0 +1,41 @@
# --- 1. 核心体验优化 ---
set -g mouse on # 开启鼠标支持:点击换面板、滚轮翻日志、拖动改分屏大小
set -g base-index 1 # 窗口编号从 1 开始(对应键盘数字键 1-90 太远了)
set -g pane-base-index 1 # 面板编号也从 1 开始
set -s escape-time 0 # 解决在 Emacs/Vim 中按 ESC 键有延迟的问题
set -g history-limit 50000 # 增加滚动回溯行数(默认 2000 太短了)
# --- 2. 快捷键重绑定 ---
# 将前缀键改为 Ctrl + a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# 更直观的分屏快捷键
bind v split-window -h -c "#{pane_current_path}" # v键垂直分屏
bind h split-window -v -c "#{pane_current_path}" # h键水平分屏
# 使用 Alt + hjkl 切换面板Vim 风格)
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
# 使用 Alt + Shift + hjkl 调整面板大小
bind -n M-H resize-pane -L 5
bind -n M-L resize-pane -R 5
bind -n M-K resize-pane -U 5
bind -n M-J resize-pane -D 5
# 快速重载配置 (Prefix + r)
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
# --- 3. 视觉与显示 ---
# 开启真彩色支持
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# 简单的状态栏美化
set -g status-style "bg=#333333,fg=#5eacd3"
set -g status-left "#[fg=green][#S] " # 左侧显示会话名
set -g status-right "%H:%M %Y-%m-%d" # 右侧显示时间

View File

@@ -19,15 +19,15 @@ fi
if command -v pacman >/dev/null 2>&1; then
# Arch/Manjaro先同步并升级系统再安装所需包
$SUDO pacman -Syu --noconfirm
$SUDO pacman -S --noconfirm exa zoxide dust bat btop fd ripgrep fzf tldr
$SUDO pacman -S --noconfirm exa zoxide dust bat btop fd ripgrep fzf tldr git vim tmux
elif command -v apt >/dev/null 2>&1; then
# Debian/Ubuntu更新索引后再安装
$SUDO apt update -y || true
$SUDO apt install -y fzf zoxide ripgrep bat fd-find btop exa
$SUDO apt install -y fzf zoxide ripgrep bat fd-find btop exa git vim tmux
elif command -v dnf >/dev/null 2>&1; then
# Fedora更新元数据后再安装
$SUDO dnf makecache -y || true
$SUDO dnf install -y exa zoxide dust bat btop fd-find ripgrep fzf tldr
$SUDO dnf install -y exa zoxide dust bat btop fd-find ripgrep fzf tldr git vim tmux
else
echo "未检测到 apt / pacman / dnf跳过安装。" >&2
fi