mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-04-25 01:36:52 +08:00
95 lines
2.6 KiB
Plaintext
95 lines
2.6 KiB
Plaintext
export TERM="xterm-256color"
|
|
export LC_ALL=C.UTF-8
|
|
export LANG=C.UTF-8
|
|
|
|
# antigen
|
|
|
|
# if test -z "$NO_WALL"; then
|
|
# ANTIGEN_OMZ_REPO_URL="https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git"
|
|
# ANTIGEN_URL="https://raw.fastgit.org/zsh-users/antigen/master/bin/antigen.zsh"
|
|
# GIHUB_PROXY="https://hub.fastgit.xyz/"
|
|
# else
|
|
# ANTIGEN_URL="git.io/antigen"
|
|
# GIHUB_PROXY=""
|
|
# fi
|
|
# antigen bundle ${GIHUB_PROXY}zsh-users/zsh-syntax-highlighting
|
|
# antigen bundle ${GIHUB_PROXY}zsh-users/zsh-completions
|
|
# antigen bundle ${GIHUB_PROXY}zsh-users/zsh-autosuggestions
|
|
ANTIGEN_OMZ_REPO_URL="https://gitee.com/dictxiong/ohmyzsh.git"
|
|
ANTIGEN_URL="https://gitee.com/dictxiong/antigen/raw/develop/bin/antigen.zsh"
|
|
ANTIGEN="$HOME/antigen.zsh"
|
|
# Install antigen.zsh if not exist
|
|
if [ ! -f "$ANTIGEN" ]; then
|
|
echo "Installing antigen ..."
|
|
TMPFILE="/tmp/antigen.zsh"
|
|
if [ -x "$(which curl)" ]; then
|
|
curl -L "$ANTIGEN_URL" -o "$TMPFILE"
|
|
elif [ -x "$(which wget)" ]; then
|
|
wget "$ANTIGEN_URL" -O "$TMPFILE"
|
|
else
|
|
echo "ERROR: please install curl or wget before installation !!"
|
|
exit
|
|
fi
|
|
if [ ! $? -eq 0 ]; then
|
|
echo ""
|
|
echo "ERROR: downloading antigen.zsh ($ANTIGEN_URL) failed !!"
|
|
exit
|
|
fi;
|
|
echo "move $TMPFILE to $ANTIGEN"
|
|
mv "$TMPFILE" "$ANTIGEN"
|
|
fi
|
|
# config and enable antigen
|
|
source "$ANTIGEN"
|
|
antigen use oh-my-zsh
|
|
# enable plugins
|
|
antigen_plugins=( \
|
|
"command-not-found" \
|
|
"docker" \
|
|
"extract" \
|
|
"fzf" \
|
|
"git" \
|
|
"ripgrep" \
|
|
"tmux" \
|
|
"ufw" \
|
|
"z" \
|
|
"https://gitee.com/dictxiong/zsh-syntax-highlighting" \
|
|
"https://gitee.com/dictxiong/zsh-completions" \
|
|
"https://gitee.com/dictxiong/zsh-autosuggestions" \
|
|
)
|
|
for i in ${antigen_plugins[*]}
|
|
do
|
|
if [[ -z $ANTIGEN_EXCLUDE || ! $i =~ $ANTIGEN_EXCLUDE ]]; then
|
|
antigen bundle $i
|
|
fi
|
|
done
|
|
# select theme
|
|
antigen theme ${ZSH_THEME:-ys}
|
|
# apply
|
|
antigen apply
|
|
# end of antigen config
|
|
|
|
# env
|
|
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
|
export PATH=$PATH:$DOTFILES/scripts
|
|
|
|
# alias
|
|
alias "pls"='sudo $(fc -ln -1)'
|
|
alias "se"='sudo -sE'
|
|
alias "pbd"='ping baidu.com'
|
|
alias "p114"='ping 114.114.114.114'
|
|
alias "p666"='ping6 2001:da8::666'
|
|
case $(bash "$DOTFILES/tools/common.sh" get_os_type) in
|
|
macos ) alias l='ls -lAGh -D "%y-%m-%d %H:%M"' ;;
|
|
* ) alias l='ls -lAGh --time-style="+%y-%m-%d %H:%M"' ;;
|
|
esac
|
|
|
|
# key bindings
|
|
bindkey "^b" beginning-of-line
|
|
bindkey "^e" end-of-line
|
|
bindkey "^[[H" beginning-of-line
|
|
bindkey "^[[F" end-of-line
|
|
bindkey "^[[1~" beginning-of-line
|
|
bindkey "^[[4~" end-of-line
|
|
bindkey "^[OH" beginning-of-line
|
|
bindkey "^[OF" end-of-line
|