lewagon/dotfiles

Include `typeset -U path` in dotfiles

SebiBasti opened this issue · 4 comments

Over time the $PATH variable can get quite bloated and have many duplicates inside.

typeset -U path

This takes care of this and checks path to only include unique values e.g. it deletes all duplicates.

https://zsh.sourceforge.io/Guide/zshguide02.html#l24

Where would it make sense to add this?

I currently have it in the bottom half of my .zshrc and had no issues.

I checked again with the help of chatGPT:

Putting it all together, the code typeset -U path is instructing the shell to modify the path variable and
ensure that it contains only unique elements. It is useful in scenarios where you want to avoid 
having duplicate directory paths in the PATH variable.

I think there's no risk in including it in .zshrc.

I created a PR 👌