feat(zsh): Finished reorganise zsh with a same entry point for all platforms

This commit is contained in:
js0ny 2024-11-30 01:29:47 +00:00
parent bd5ca49c3e
commit 2b21b63a13
22 changed files with 503 additions and 369 deletions

View file

@ -1,33 +0,0 @@
# pip
alias pip=pip3
alias python=python3
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# npm
npm config set registry https://registry.npmmirror.com
# Homebrew
# 手动设置
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
# 注:自 brew 4.0 起,大部分 Homebrew 用户无需设置 homebrew/core 和 homebrew/cask 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。
# 如果需要使用 Homebrew 的开发命令 (如 `brew cat <formula>`),则仍然需要设置 homebrew/core 和 homebrew/cask 镜像。
# 请按需执行如下两行命令:
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
# 除 homebrew/core 和 homebrew/cask 仓库外的 tap 仓库仍然需要设置镜像
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git
brew update
# 或使用下面的几行命令自动设置
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
for tap in core cask{,-fonts,-versions} command-not-found services; do
brew tap --custom-remote --force-auto-update "homebrew/${tap}" "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-${tap}.git"
done
brew update

View file

@ -1,22 +1,15 @@
# $XDG_CONFIG_HOME/zsh/.zshrc
# ln -s $DOTFILES/mac/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
### Variables ###
# $DOTFILES/platforms/mac/zshrc
# Sourced by user's zshrc if is macOS 在用户的 zshrc 中被引用macOS 特定配置
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
export DOTFILES="$HOME/.dotfiles"
# Homebrew Path
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
for file in $DOTFILES/zsh/*.zsh; do
source $file
done
export ARCHFLAGS="-arch arm64"
### Navigation ###
# Absolute navigation
alias doku="cd ~/doku && ls"
alias docs="cd ~/Documents"
alias dt="cd ~/Desktop"
alias down="cd ~/Downloads"
alias one="cd ~/OneDrive"
alias gdrive="cd ~/Google\ Drive"
# macOS #
alias xclip="pbcopy"
alias clip="pbcopy"
alias paste="pbpaste"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
@ -33,16 +26,3 @@ fi
unset __conda_setup
# <<< conda initialize <<<
# >>> juliaup initialize >>>
# !! Contents within this block are managed by juliaup !!
path=('$HOME/.juliaup/bin' $path)
export PATH
# <<< juliaup initialize <<<
# macOS #
alias xclip="pbcopy"
alias clip="pbcopy"