ZSH: Beginning of reconfiguring everything

This commit is contained in:
2024-10-28 12:31:50 +01:00
parent e130455648
commit 154209ffd7
31 changed files with 145 additions and 413 deletions

19
.config/zsh/conf.d/10-path.zsh Executable file
View File

@@ -0,0 +1,19 @@
# Set $PATH
# Put only directories in $PATH that exist and remove duplicates
typeset -U path # No duplicates
path=()
_prepath() {
for dir in "$@"; do
dir=${dir:A}
[[ ! -d "$dir" ]] && return
#path=("$dir" $path[@])
path=("$dir" $path)
done
}
_prepath /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/local/sbin # BSD and macOS
_prepath /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin # Homebrew on macOS
_prepath ~/bin ~/.local/bin # $HOME
unfunction _prepath