mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
fix(zsh): Cleanup environment variable
This commit is contained in:
parent
567c8d1b3b
commit
9436322a73
4 changed files with 24 additions and 5 deletions
|
|
@ -4,9 +4,6 @@
|
|||
# Sourced by user's zshrc if is macOS 在用户的 zshrc 中被引用,macOS 特定配置
|
||||
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
|
||||
|
||||
# Homebrew Path
|
||||
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
|
||||
|
||||
# macOS #
|
||||
|
||||
alias xclip="pbcopy"
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ done
|
|||
set -k
|
||||
|
||||
# TODO: Below should be reorganized
|
||||
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
||||
export PATH=$HOME/.local/share/gem/ruby/3.3.0/bin:$PATH # Ruby Executables
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
|
||||
export NVM_DIR="$HOME/.config/nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
|
|
|
|||
|
|
@ -33,6 +33,15 @@ export PAGER="less -R"
|
|||
export EDITOR="nvim"
|
||||
export VISUAL="nvim"
|
||||
|
||||
# Minimal PATH for early commands
|
||||
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
|
||||
|
||||
if [ -d "/opt/homebrew/bin" ]; then # macOS
|
||||
export PATH="/opt/homebrew/bin:$PATH"
|
||||
elif [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then # Linux
|
||||
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
|
||||
fi
|
||||
|
||||
# macOS Specific
|
||||
# This syntax is POSIX standard, for portability
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
|
|
@ -52,6 +61,7 @@ fi
|
|||
# Cargo
|
||||
if command -v cargo > /dev/null; then
|
||||
export CARGO_HOME="$XDG_DATA_HOME"/cargo
|
||||
export PATH="$CARGO_HOME/bin:$PATH"
|
||||
fi
|
||||
# CGDB
|
||||
if command -v cgdb > /dev/null; then
|
||||
|
|
@ -60,6 +70,7 @@ fi
|
|||
# .NET
|
||||
if command -v dotnet > /dev/null; then
|
||||
export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet
|
||||
export PATH="$DOTNET_CLI_HOME/.dotnet/tools:$PATH"
|
||||
fi
|
||||
# Docker
|
||||
if command -v docker > /dev/null; then
|
||||
|
|
@ -72,6 +83,7 @@ fi
|
|||
# Go
|
||||
if command -v go > /dev/null; then
|
||||
export GOPATH="$XDG_DATA_HOME"/go
|
||||
export PATH="$GOPATH/bin:$PATH"
|
||||
fi
|
||||
# Julia
|
||||
if command -v julia > /dev/null; then
|
||||
|
|
@ -100,6 +112,17 @@ if command -v screen > /dev/null; then
|
|||
export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
|
||||
export SCREENDIR="${XDG_RUNTIME_DIR}/screen"
|
||||
fi
|
||||
# Ruby Gem
|
||||
# Ruby Gem
|
||||
if command -v gem > /dev/null; then
|
||||
setopt nullglob
|
||||
for dir in "$HOME/.local/share/gem/ruby/"*/bin; do
|
||||
if [ -d "$dir" ]; then
|
||||
export PATH="$dir:$PATH"
|
||||
fi
|
||||
done
|
||||
unsetopt nullglob
|
||||
fi
|
||||
# Spacemacs
|
||||
if command -v emacs > /dev/null; then
|
||||
export SPACEMACSDIR="$XDG_CONFIG_HOME"/spacemacs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue