diff --git a/.zprofile b/.zprofile index f32077e..3adcde5 100644 --- a/.zprofile +++ b/.zprofile @@ -5,23 +5,25 @@ export CGO_ENABLED="1" HMVARSFILE="$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" if [ -f "$HMVARSFILE" ]; then . "$HMVARSFILE"; fi -add_to_path() { - local p=$1 - if [[ ! "$PATH" == *"$p"* ]]; then - export PATH="$p:$PATH" - fi -} -add_to_path "/usr/local/goroot/bin" -add_to_path "$HOME/.asdf/shims" -add_to_path "$HOME/.arkade/bin" -add_to_path "$HOME/.cargo/bin" -add_to_path "$GOPATH/bin" -add_to_path "/opt/metasploit-framework/bin" -add_to_path "$HOME/.local/share/flatpak/exports/bin" -add_to_path "/var/lib/flatpak/exports/bin" -add_to_path "$HOME/.local/share/JetBrains/Toolbox/bin" -add_to_path "$HOME/.local/share/JetBrains/Toolbox/scripts" +local __paths=( + "/usr/local/goroot/bin" + "$HOME/.asdf/shims" + "$HOME/.arkade/bin" + "$HOME/.cargo/bin" + "$GOPATH/bin" + "/opt/metasploit-framework/bin" + "$HOME/.local/share/flatpak/exports/bin" + "/var/lib/flatpak/exports/bin" + "$HOME/.local/share/JetBrains/Toolbox/bin" + "$HOME/.local/share/JetBrains/Toolbox/scripts" +) + +for p in $__paths[@]; do + add_to_path $p +done +unset __paths + export EDITOR='vim' export TERM='xterm-256color' diff --git a/.zshenv b/.zshenv index 42e1f33..16b32d9 100644 --- a/.zshenv +++ b/.zshenv @@ -29,20 +29,28 @@ add_to_path() { fi } -add_to_path "/usr/lib64/ccache" -add_to_path "$ANDROID_SDK_ROOT/platform-tools" -add_to_path "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin" -add_to_path "$ANDROID_SDK_ROOT/tools" -add_to_path "$ANDROID_SDK_ROOT/tools/bin" -add_to_path "$HOME/.local/share/JetBrains/Toolbox/bin" -add_to_path "$HOME/.npm-packages/bin" -add_to_path "/var/lib/flatpak/exports/bin" -add_to_path "$HOME/.local/share/flatpak/exports/bin" -add_to_path "/opt/metasploit-framework/bin" -add_to_path "$HOME/.cargo/bin" -add_to_path "$GOPATH/bin" -add_to_path "$HOME/.arkade/bin" -add_to_path "$HOME/.asdf/bin" -add_to_path "$HOME/.asdf/shims" -add_to_path "$HOME/.local/bin" -add_to_path "$HOME/utils/bin" +local __paths=( + "/usr/lib64/ccache" + "$ANDROID_SDK_ROOT/platform-tools" + "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin" + "$ANDROID_SDK_ROOT/tools" + "$ANDROID_SDK_ROOT/tools/bin" + "$HOME/.local/share/JetBrains/Toolbox/bin" + "$HOME/.npm-packages/bin" + "/var/lib/flatpak/exports/bin" + "$HOME/.local/share/flatpak/exports/bin" + "/opt/metasploit-framework/bin" + "$HOME/.cargo/bin" + "$GOPATH/bin" + "$HOME/.arkade/bin" + "$HOME/.asdf/bin" + "$HOME/.asdf/shims" + "$HOME/.local/bin" + "$HOME/utils/bin" +) + +for p in $__paths[@]; do + add_to_path $p +done + +unset __paths