zsh: Move PATH changes to .zprofile
This commit is contained in:
parent
92cf12fe92
commit
60faca005f
4 changed files with 29 additions and 29 deletions
|
|
@ -38,5 +38,6 @@
|
||||||
~/.tmux.conf: tmux/.tmux.conf
|
~/.tmux.conf: tmux/.tmux.conf
|
||||||
~/.vimrc: vim/.vimrc
|
~/.vimrc: vim/.vimrc
|
||||||
~/.vim: vim/
|
~/.vim: vim/
|
||||||
|
~/.zprofile: zsh/.zprofile
|
||||||
~/.zshenv: zsh/.zshenv
|
~/.zshenv: zsh/.zshenv
|
||||||
~/.zshrc: zsh/.zshrc
|
~/.zshrc: zsh/.zshrc
|
||||||
|
|
|
||||||
28
etc/profile
28
etc/profile
|
|
@ -2,34 +2,6 @@ has() {
|
||||||
command -V "$1" > /dev/null 2>&1
|
command -V "$1" > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
source_if() {
|
|
||||||
if [ -e "$1" ]; then
|
|
||||||
source "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
path_if() {
|
|
||||||
if [ -d "$1" ]; then
|
|
||||||
case ":$PATH:" in
|
|
||||||
*:"$1":*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PATH="${1}${PATH:+:$PATH}"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
|
||||||
|
|
||||||
path_if "$HOME/bin"
|
|
||||||
path_if "$HOME/.local/bin"
|
|
||||||
path_if /usr/local/bin
|
|
||||||
path_if /opt/homebrew/bin
|
|
||||||
path_if /opt/homebrew/sbin
|
|
||||||
|
|
||||||
unset -f source_if
|
|
||||||
unset -f path_if
|
|
||||||
|
|
||||||
if has gnome-keyring-daemon; then
|
if has gnome-keyring-daemon; then
|
||||||
eval "$(gnome-keyring-daemon --start)"
|
eval "$(gnome-keyring-daemon --start)"
|
||||||
export SSH_AUTH_SOCK
|
export SSH_AUTH_SOCK
|
||||||
|
|
|
||||||
27
zsh/.zprofile
Normal file
27
zsh/.zprofile
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
source_if() {
|
||||||
|
if [ -e "$1" ]; then
|
||||||
|
source "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
path_if() {
|
||||||
|
if [ -d "$1" ]; then
|
||||||
|
case ":$PATH:" in
|
||||||
|
*:"$1":*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
PATH="${1}${PATH:+:$PATH}"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
||||||
|
|
||||||
|
path_if "$HOME/bin"
|
||||||
|
path_if "$HOME/.local/bin"
|
||||||
|
path_if /usr/local/bin
|
||||||
|
path_if /opt/homebrew/bin
|
||||||
|
path_if /opt/homebrew/sbin
|
||||||
|
|
||||||
|
unset -f source_if
|
||||||
|
unset -f path_if
|
||||||
|
|
@ -73,7 +73,7 @@ ${prompt}"
|
||||||
export RPROMPT=''
|
export RPROMPT=''
|
||||||
|
|
||||||
# aliases
|
# aliases
|
||||||
source $HOME/.profile
|
source $HOME/.zprofile
|
||||||
source $HOME/.config/zsh/aliases
|
source $HOME/.config/zsh/aliases
|
||||||
|
|
||||||
source $HOME/.config/zsh/j.sh
|
source $HOME/.config/zsh/j.sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue