hotalexnet/.kshrc
2025-09-19 16:58:30 +08:00

38 lines
933 B
Bash

export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
HISTFILE=$HOME/.ksh_history
HISTSIZE=1000
SAVEHIST=1000
alias ls='colorls -Ga'
alias ll='colorls -Gal'
alias df='df -h'
alias du='du -sh'
alias ifconfig='$HOME/bin/color_ifconfig'
alias kitty="GLFW_IM_MODULE=ibus kitty"
# git 分支显示
git_branch() {
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || return
status=""
if git rev-parse --abbrev-ref @{u} > /dev/null 2>&1; then
ahead=$(git rev-list --count @{u}..HEAD 2>/dev/null)
behind=$(git rev-list --count HEAD..@{u} 2>/dev/null)
if [ "$ahead" -gt 0 ]; then
status="$status$ahead"
fi
if [ "$behind" -gt 0 ]; then
status="$status$behind"
fi
fi
print " ($branch$status)"
}
#set -o vi
export PS1='\[\e[33m\]\h\w\[\e[0m\]$ '
#export PS1='$(print "\033[1;32m$USER\033[0m@\033[1;34m$(hostname -s)\033[0m:\033[1;33m$PWD\033[0m$(git_branch)\n$ ")'