Skip to content

Commit f891776

Browse files
Merge pull request #237 from StrangeRanger/renovate/submodules-dotfiles-digest
2 parents 75591cb + 3123a07 commit f891776

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Entries under the **Removed** section indicate items removed from the entire doc
1010

1111
## Unreleased
1212

13+
## 2025-12-11
14+
15+
### Changed
16+
17+
- changed(zshrc): refactor PATH and implement removal of dups in PATH
18+
1319
## 2025-09-30
1420

1521
### Changed

includes/zshrc-files/zshrc-linux.zsh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,18 @@ Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.'"
187187
# 1Password auth socket.
188188
export SSH_AUTH_SOCK="$HOME/.1password/agent.sock"
189189

190+
orig_path="$PATH"
190191
## Path purpose:
191-
## - $HOME/.local/bin:User installed binaries.
192-
## - $HOME/.dotnet/tools: .NET Core tools.
193-
## - $HOME/.local/share/gem/ruby/3.3.0/bin: Ruby gems.
192+
## - $HOME/.local/bin: Local binaries installed by the user.
193+
## - $HOME/.dotnet/tools: Local .NET Core tools.
194194
## - /opt/nvim/bin: Neovim binary.
195-
export PATH="$HOME/.local/bin:$PATH"
196-
[[ -d $HOME/.dotnet/tools ]] && export PATH="$HOME/.dotnet/tools:$PATH"
197-
[[ -d $HOME/.local/share/gem/ruby/3.3.0/bin ]] && export PATH="$HOME/.local/share/gem/ruby/3.3.0/bin:$PATH"
198-
[[ -d /opt/nvim/bin ]] && export PATH="/opt/nvim/bin:$PATH"
195+
new_path="$HOME/.local/bin"
196+
[[ -d /opt/nvim/bin ]] && new_path="$new_path:/opt/nvim/bin"
197+
[[ -d $HOME/.dotnet/tools ]] && new_path="$new_path:$HOME/.dotnet/tools"
198+
PATH="$new_path:$orig_path"
199+
typeset -U path # Ensure all dirs in PATH are unique, preserving the first occurrence.
200+
export PATH
201+
unset orig_path new_path
199202

200203
# Modifies the colors of files and directories in the terminal.
201204
export LS_COLORS="di=34:ln=36:so=35:pi=1;33:ex=32:bd=34;46:cd=1;33;40:su=30;41:sg=30;46:tw=30;42:ow=30;1;43"

includes/zshrc-files/zshrc-macos.zsh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,20 @@ Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.'"
161161
export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
162162

163163
hb_prefix="$(brew --prefix 2>/dev/null || echo "/opt/homebrew")"
164-
# Path purpose:
165-
# - $hb_prefix/opt/trash-cli/bin: Homebrew installed trash-cli binary.
166-
# - $HOME/.local/bin: User installed binaries.
167-
# - $HOME/.cargo/bin: Rust installed binaries.
168-
export PATH="$hb_prefix/opt/trash-cli/bin:$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
169-
unset hb_prefix
164+
orig_path="$PATH"
165+
## Path purpose:
166+
## - $HOME/.local/bin: User installed binaries.
167+
## - $HOME/.cargo/bin: Rust installed binaries.
168+
## - $hb_prefix/bin: Homebrew installed user binaries.
169+
## - $hb_prefix/sbin: Homebrew installed system binaries.
170+
## - $hb_prefix/opt/trash-cli/bin: Homebrew installed trash-cli binary.
171+
new_path="$HOME/.local/bin:$HOME/.cargo/bin"
172+
new_path="$new_path:$hb_prefix/bin:$hb_prefix/sbin"
173+
new_path="$new_path:$hb_prefix/opt/trash-cli/bin"
174+
PATH="$new_path:$orig_path"
175+
typeset -U path # Ensure all dirs in PATH are unique, preserving the first occurrence.
176+
export PATH
177+
unset hb_prefix orig_path new_path
170178

171179
# Modifies the colors of files and directories when using `ls`.
172180
export LSCOLORS="exgxfxDxcxegDaabagacaD"

0 commit comments

Comments
 (0)