LuckyWindsck / dotfiles

(Still under working)
0 stars 0 forks source link

Migrate from antigen to antidote #1

Open LuckyWindsck opened 1 year ago

LuckyWindsck commented 1 year ago

Summary

I am going to migrate the zsh plugin manager I used from antigen to antidote.

Reasons for migration

antigen is in maintenance mode, no new features.

Why antidote?

antidote satisfied all following requirements I need.

  1. antidote has NO dependency other than zsh.
  2. antidote satisfies basic CRUD features for plugin management.
  3. antidote partially supports XDG Base Directory Specification.
    • It provide an environment variable, ANTIDOTE_HOME, to set home folder.
  4. antidote supports pre / post hook.
    • pre hook allows me to set environment variables for some plugins before I use them.
      • I need it to fix this bug of zsh-highlighting.
    • post hook allows me to run a patch script to fix or enhance some plugins.
      • I need it to fix this bug of zsh-autosuggestions.
    • Of course I can write plugins to do what I want, but if I use hooks, I don't need to worry about the plugin order.
  5. antidote supports async load (defer).
  6. antidote supports specifying branch.
  7. antidote supports using local plugin natively.

Also, antidote has an official repo for example zsh config that uses antidote.

Why not other plugin manager?

I've compared all zsh plugin managers listed in zsh_unplugged that are acitve and fast.

  1. Most of them didn't satisfy my requirements listed above.
  2. The rest of them do too many things, while antidote is simple enough and it only focuses on plugin management.
    • antigen will run compint automatically.
    • zinit does too many other things, and it has a steep learning curve for me.
LuckyWindsck commented 1 year ago

antigen does support hook with the antigen-add-hook function, and I did implement hooks with that function.

However, it seems like that the antigen-add-hook function will only be load once due to the cache feature of antigen. When I open a new interactive shell, zsh will warn that "command not found: antigen-add-hook". So I've tried to disable the cache feature, but then other issue occurs. (See: Disabling cache causes issue with git plugin) Although there is workaround to fix it, it's not recommended by official guide due to performance issue.

Anyway, antigen is slow and it is not active now, so I decided to migrate to antidote.