You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
surce /usr/share/zinit/zinit.zsh
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
zinit for \
atload"zicompinit; zicdreplay" \
blockf \
lucid \
wait \
zsh-users/zsh-completions
zinit load nbari/test <--- here my test repo
zinit light kutsan/zsh-system-clipboard
zinit light zsh-users/zsh-syntax-highlighting
in repo nbari/test/test.plugin.zsh I have:
0=${(%):-%N}
source ${0:A:h}/test.zsh
And in test.zsh I am trying to set this alias:
if (( ${+commands[exa]} )); then
LS_COMMAND='exa'
elif (( ${+commands[eza]} )); then
LS_COMMAND='eza'
else
LS_COMMAND='ls'
fi
if [[ $LS_COMMAND == 'ls' ]]; then
alias l='ls -lah'
alias ll='ls -alF'
alias la='ls -A'
else
alias ls="$LS_COMMAND"
alias l="$LS_COMMAND -l --all --group-directories-first --git"
...
fi
If I load the .zsh with source test.zsh it works and LS_COMMAND is set to exa, but when loading it with zinit zinit load nbari/test it always defaults to ls.
Any idea of why this happens? how could I load alias using either exa or eza if found?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, this is my current
.zsrhc
in repo
nbari/test/test.plugin.zsh
I have:And in
test.zsh
I am trying to set this alias:If I load the .zsh with
source test.zsh
it works andLS_COMMAND
is set to exa, but when loading it with zinitzinit load nbari/test
it always defaults tols
.Any idea of why this happens? how could I load alias using either
exa
oreza
if found?Beta Was this translation helpful? Give feedback.
All reactions