Start Refactoring to composable zsh config modules

This commit is contained in:
Marty Oehme 2019-02-18 17:55:05 +01:00
parent 764de81461
commit 71a7ca83c6
24 changed files with 643 additions and 296 deletions

View file

@ -0,0 +1,19 @@
# In case a plugin adds a redundant path entry, remove duplicate entries
# from PATH
#
# This snippet is from Mislav Marohnić <mislav.marohnic@gmail.com>'s
# dotfiles repo at https://github.com/mislav/dotfiles
dedupe_path() {
typeset -a paths result
paths=($path)
while [[ ${#paths} -gt 0 ]]; do
p="${paths[1]}"
shift paths
[[ -z ${paths[(r)$p]} ]] && result+="$p"
done
export PATH=${(j+:+)result}
}
dedupe_path