diff options
| author | seth <[email protected]> | 2023-01-24 04:58:39 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-01-24 04:58:39 -0500 |
| commit | f4f678d4c76751abcae45cd36e430d0bd767368e (patch) | |
| tree | 8e5b1e8af3213a57ac780e68ff3297054f7ef4fe | |
| parent | 53bf151a5387ef2ad45cb8d67af76bf8eb218b8c (diff) | |
improve shell configs
| -rw-r--r-- | .bash_profile | 13 | ||||
| -rw-r--r-- | .bashrc | 6 | ||||
| -rw-r--r-- | .config/fish/config.fish | 15 | ||||
| -rw-r--r-- | .config/zsh/.zshenv | 17 |
4 files changed, 29 insertions, 22 deletions
diff --git a/.bash_profile b/.bash_profile index b8ea799..175d556 100644 --- a/.bash_profile +++ b/.bash_profile @@ -5,10 +5,15 @@ source "${HOME}/.config/shell/profile" + +declare -a paths=("$HOME/.local/bin" \ + "$HOME/.local/share/nvim/mason/bin" \ +) + # add user's bin directory to path -if [ -d "${HOME}/.local/bin" ] -then - export PATH="${HOME}/.local/bin:${PATH}" -fi +for path in "${paths[@]}"; do + [ -d "$path" ] && \ + export PATH="$path:${PATH}" +done source "${HOME}/.bashrc" @@ -3,12 +3,6 @@ # getchoo's bashrc # -# drop into fish -## if [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ${BASH_EXECUTION_STRING} ]] -## then -## exec fish -## fi - # options shopt -s cdspell shopt -s checkjobs diff --git a/.config/fish/config.fish b/.config/fish/config.fish index d51d808..0ee4928 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -6,9 +6,14 @@ function set_envvars # source bash profile bash2env source "$HOME/.config/shell/profile" - # add user bin directory to path - if test -d "$HOME/.local/bin" - fish_add_path "$HOME/.local/bin" + set -l paths "$HOME/.local/bin" \ + "$HOME/.local/share/nvim/mason/bin" + + # add user directories to path + for path in $paths + if test -d $path + fish_add_path $path + end end end @@ -30,6 +35,6 @@ end if status is-interactive || status is-login load_plugins set_envvars -else - set_envvars end + +set_envvars diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index e63874b..d0614df 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -1,15 +1,18 @@ # # getchoo's zshenv # - source "${HOME}/.config/shell/profile" -# add user's bin directory to path -typeset -U path PATH +# add user directories to path +typeset -U paths=("$HOME/.local/bin" \ + "$HOME/.local/share/nvim/mason/bin" \ +) + +typeset -U path -if [[ -d "${HOME}/.local/bin" ]]; then - path=("${HOME}/.local/bin" "$path[@]") - export PATH -fi +for p in "${paths[@]}"; do + [[ -d "$p" ]] && \ + path=("$p" "$path[@]") +done zstyle ':antidote:bundle' use-friendly-names 'yes' # don't use ugly dirs |
