feat: 现代化终端体验升级
- 新增包:starship, atuin, direnv, xh, yq, sd, zellij - 重写 .zshrc:Starship 提示符、Atuin 历史搜索、fzf 键绑定、 增强别名(eza --icons, ll, la, lt)、shell 选项、WSL 剪贴板 - 新增 starship.toml 配置 - 优化 git config:SSL 限定到内网地址、pull.rebase、 push.autoSetupRemote、rerere、delta line-numbers
This commit is contained in:
+10
-1
@@ -1,4 +1,4 @@
|
|||||||
[http]
|
[http "https://202.127.0.42:32443"]
|
||||||
sslVerify = false
|
sslVerify = false
|
||||||
[core]
|
[core]
|
||||||
pager = delta
|
pager = delta
|
||||||
@@ -7,7 +7,16 @@
|
|||||||
[delta]
|
[delta]
|
||||||
navigate = true
|
navigate = true
|
||||||
side-by-side = true
|
side-by-side = true
|
||||||
|
line-numbers = true
|
||||||
[credential]
|
[credential]
|
||||||
helper = store
|
helper = store
|
||||||
[merge]
|
[merge]
|
||||||
conflictstyle = zdiff3
|
conflictstyle = zdiff3
|
||||||
|
[pull]
|
||||||
|
rebase = true
|
||||||
|
[push]
|
||||||
|
autoSetupRemote = true
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
[rerere]
|
||||||
|
enabled = true
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
format = """
|
||||||
|
$username\
|
||||||
|
$hostname\
|
||||||
|
$directory\
|
||||||
|
$git_branch\
|
||||||
|
$git_status\
|
||||||
|
$nodejs\
|
||||||
|
$python\
|
||||||
|
$go\
|
||||||
|
$rust\
|
||||||
|
$cmd_duration\
|
||||||
|
$line_break\
|
||||||
|
$character"""
|
||||||
|
|
||||||
|
[character]
|
||||||
|
success_symbol = "[❯](bold green)"
|
||||||
|
error_symbol = "[❯](bold red)"
|
||||||
|
|
||||||
|
[directory]
|
||||||
|
truncation_length = 3
|
||||||
|
truncation_symbol = "…/"
|
||||||
|
|
||||||
|
[git_branch]
|
||||||
|
symbol = " "
|
||||||
|
|
||||||
|
[git_status]
|
||||||
|
format = '([\[$all_status$ahead_behind\]]($style) )'
|
||||||
|
|
||||||
|
[cmd_duration]
|
||||||
|
min_time = 2000
|
||||||
|
format = "[$duration]($style) "
|
||||||
|
|
||||||
|
[nodejs]
|
||||||
|
format = "[$symbol($version)]($style) "
|
||||||
|
detect_extensions = []
|
||||||
|
|
||||||
|
[python]
|
||||||
|
format = "[$symbol($version)]($style) "
|
||||||
|
|
||||||
|
[go]
|
||||||
|
format = "[$symbol($version)]($style) "
|
||||||
+49
-23
@@ -1,37 +1,63 @@
|
|||||||
# PATH
|
# ── PATH ──
|
||||||
export PATH="$HOME/go/bin:$PATH"
|
export PATH="$HOME/go/bin:$HOME/.bun/bin:$PATH"
|
||||||
export PATH="$HOME/.bun/bin:$PATH"
|
|
||||||
|
|
||||||
# Oh My Zsh
|
# ── Shell 选项 ──
|
||||||
|
setopt AUTO_CD # 输目录名直接 cd
|
||||||
|
setopt INTERACTIVE_COMMENTS # 允许交互式 # 注释
|
||||||
|
setopt NO_BEEP # 关蜂鸣
|
||||||
|
|
||||||
|
# ── Oh My Zsh ──
|
||||||
ZSH=/usr/share/oh-my-zsh/
|
ZSH=/usr/share/oh-my-zsh/
|
||||||
ZSH_THEME="ys"
|
ZSH_THEME="" # Starship 接管提示符
|
||||||
plugins=(git)
|
plugins=(
|
||||||
|
git # git 别名(gst, gco, gp...)
|
||||||
|
sudo # 双击 ESC 自动加 sudo
|
||||||
|
extract # x file.tar.gz 一键解压任何格式
|
||||||
|
direnv # direnv hook
|
||||||
|
)
|
||||||
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
|
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
|
||||||
if [[ ! -d $ZSH_CACHE_DIR ]]; then
|
[[ ! -d $ZSH_CACHE_DIR ]] && mkdir -p $ZSH_CACHE_DIR
|
||||||
mkdir $ZSH_CACHE_DIR
|
|
||||||
fi
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
# ── 外部插件 ──
|
||||||
source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh
|
source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh
|
||||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # 必须最后
|
||||||
|
|
||||||
# mise
|
# ── 工具初始化(顺序重要)──
|
||||||
if command -v mise &> /dev/null; then
|
eval "$(starship init zsh)"
|
||||||
eval "$(mise activate zsh)"
|
eval "$(zoxide init zsh)"
|
||||||
fi
|
eval "$(mise activate zsh)"
|
||||||
|
eval "$(fzf --zsh)" # Ctrl+T 搜文件, Alt+C 搜目录
|
||||||
|
eval "$(atuin init zsh)" # 必须在 fzf 之后,接管 Ctrl+R
|
||||||
|
|
||||||
# zoxide
|
# ── 别名 ──
|
||||||
if command -v zoxide &> /dev/null; then
|
# 导航
|
||||||
eval "$(zoxide init zsh)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Aliases
|
|
||||||
alias cd="z"
|
alias cd="z"
|
||||||
alias cdi="zi"
|
alias cdi="zi"
|
||||||
alias ls="eza"
|
alias ..="cd .."
|
||||||
alias tree="eza --tree"
|
alias ...="cd ../.."
|
||||||
|
|
||||||
|
# 文件列表
|
||||||
|
alias ls="eza --icons --group-directories-first"
|
||||||
|
alias ll="eza -la --icons --git --group-directories-first"
|
||||||
|
alias la="eza -a --icons --group-directories-first"
|
||||||
|
alias lt="eza --tree --level=2 --icons"
|
||||||
|
|
||||||
|
# 工具
|
||||||
alias cat="bat --paging=never"
|
alias cat="bat --paging=never"
|
||||||
alias rm="trash-put"
|
alias rm="trash-put"
|
||||||
|
alias lg="lazygit"
|
||||||
|
alias vi="nvim"
|
||||||
|
|
||||||
# Local
|
# 网络
|
||||||
|
alias http="xh"
|
||||||
|
|
||||||
|
# ── WSL 剪贴板 ──
|
||||||
|
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
||||||
|
alias pbcopy="clip.exe"
|
||||||
|
alias pbpaste="powershell.exe -noprofile -c Get-Clipboard"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ── Local ──
|
||||||
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
|
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
|
||||||
|
|||||||
@@ -21,16 +21,22 @@ class BaseModule(Module):
|
|||||||
source_file="./home/.config/git/config",
|
source_file="./home/.config/git/config",
|
||||||
owner=self.user,
|
owner=self.user,
|
||||||
),
|
),
|
||||||
|
f"/home/{self.user}/.config/starship.toml": File(
|
||||||
|
source_file="./home/.config/starship.toml",
|
||||||
|
owner=self.user,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
@pacman_packages
|
@pacman_packages
|
||||||
def pacman_packages(self) -> set[str]:
|
def pacman_packages(self) -> set[str]:
|
||||||
return {
|
return {
|
||||||
|
"atuin",
|
||||||
"base-devel",
|
"base-devel",
|
||||||
"base",
|
"base",
|
||||||
"bat",
|
"bat",
|
||||||
"btop",
|
"btop",
|
||||||
"curl",
|
"curl",
|
||||||
|
"direnv",
|
||||||
"duf",
|
"duf",
|
||||||
"dust",
|
"dust",
|
||||||
"eza",
|
"eza",
|
||||||
@@ -42,12 +48,16 @@ class BaseModule(Module):
|
|||||||
"micro",
|
"micro",
|
||||||
"procs",
|
"procs",
|
||||||
"ripgrep",
|
"ripgrep",
|
||||||
|
"sd",
|
||||||
|
"starship",
|
||||||
"sudo",
|
"sudo",
|
||||||
"tealdeer",
|
"tealdeer",
|
||||||
"trash-cli",
|
"trash-cli",
|
||||||
"vim",
|
"vim",
|
||||||
"wget",
|
"wget",
|
||||||
|
"xh",
|
||||||
"yazi",
|
"yazi",
|
||||||
|
"yq",
|
||||||
"zoxide",
|
"zoxide",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class DevModule(Module):
|
|||||||
"tmux",
|
"tmux",
|
||||||
"uv",
|
"uv",
|
||||||
"yaml-language-server",
|
"yaml-language-server",
|
||||||
|
"zellij",
|
||||||
}
|
}
|
||||||
|
|
||||||
def after_update(self, store):
|
def after_update(self, store):
|
||||||
|
|||||||
Reference in New Issue
Block a user