Files
dotfiles/dot/.bashrc
Zedhugh Chen 77509f565a dot: 重构 bashrc.d 目录结构,调整版本(包)管理器脚本加载顺序
- 将 mise、rust 等管理器脚本移入 manager/ 子目录,与工具脚本区分
- mise/volta 的补全改到各自 activate 函数内延迟生成,避免未激活时执行
- 新增 uv/uvx 的 bash 补全
- .bashrc 拆分为先加载 manager/ 再加载顶层脚本的两段流程
- .xprofile 改用 bash 解释并复用相同的脚本加载流程
2026-07-11 02:20:11 +08:00

66 lines
1.7 KiB
Bash

# /etc/skel/.bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
# Put your fun stuff here.
HISTCONTROL=ignoreboth
#export PATH="~/.local/bin:/usr/lib/distcc/bin:${PATH}"
# export PATH="~/.local/bin/:/usr/lib/ccache/bin${PATH:+:}$PATH"
# export CCACHE_DIR="/var/cache/ccache"
export GPG_TTY=$(tty)
export PATH="${HOME}/.local/bin${PATH:+:}$PATH"
alias ll="ls -l"
alias la="ls -a"
alias lh="ls -lh"
alias lha="ls -lha"
if [[ "$TERM" == "linux" ]]; then
PS1="(tty) $PS1"
elif [[ "$TERM" == "fbterm" ]]; then
PS1="(fbterm) $PS1"
fi
# use fbterm to show CJK charactor in tty
if [[ "$TERM" == "linux" ]] && [[ -x $(type -p fbterm) ]]; then
fbterm
elif [[ "${TERM}" != "tmux-256color" ]] && [[ -z "${TERM_PROGRAM}" ]] && [[ -x $(type -p tmux) ]]; then
tmux
fi
# bash completion error
if [[ -n $(type -t _comp__split_longopt) ]] && [[ -z $(type -t _split_longopt) ]]; then
alias _split_longopt="_comp__split_longopt"
fi
for _ in ${HOME}/.bashrc.d/manager/*; do
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
source "$_"
fi
done
if [[ -n "$(type -t mise-activate)" ]]; then
mise-activate
fi
for _ in ${HOME}/.bashrc.d/*; do
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
source "$_"
fi
done