0

I want to use these plugins using zinit to load git completions in zsh

zinit wait lucid for \
  OMZL::git.zsh \
  OMZP::git

But I don't care about the aliases, there are really too much aliases I already have my own.

How can I skip these alias definitions ?

I tried to disable alias command while plugin load but it doesn't work

zinit wait lucid for \
  atinit"alias alias=" \
  atload"unalias alias" \
  OMZL::git.zsh \
  OMZP::git

Any ideas ?

1 Answer 1

0

I found this solution that seems to work well

zinit wait lucid for \
  atinit'save_aliases=$(alias -L)' \
  atload'unalias -m "*"; eval ${save_aliases}; unset save_aliases' \
  OMZP::git

I also get rid of the library OMZL::git.zsh as I'm using powerlevel10k (it was redundant)

But after adding this trick to other plugins like kube or git plugins, there was a side effect as plugin loading system is done asynchronously.

I ended up with this that seems to work well so far, I simply aliased alias command to nothing just before the plugin is loaded (make stage).

zinit ice as"completion"
zinit wait lucid depth=1 for \
  make'alias alias=' \
  OMZP::docker \
  make'alias alias=' \
  OMZP::docker-compose

Note: the alias command is restored at the end of the process so I guess that the commands added to make stage are scopped to zinit loading.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .