环境快速切换

npm registry

配置 alias

1
2
3
# .bashrc / .zshrc
alias npm-default="npm config set registry https://registry.npmjs.org"
alias npm-taobao="npm config set registry https://registry.npmmirror.com"

.npmrc 文件

1
registry=https://registry.npmmirror.com

JDK

alias

1
2
3
4
alias jdk8="export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home"
alias jdk11="export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home"
alias jdk17="export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home"
alias jdk21="export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home"

git快捷

alias

1
2
3
4
5
6
7
8
9
10
function gcu() {
# 获取当前时间
now=$(date +'%Y-%m-%d %H:%M:%S')
# 提交代码,并将当前时间追加到信息末尾
git commit -m "UPDATE [$now]"
}

alias ga='git add --all'
alias gc='gcu'
alias gp='git push'