zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.77k stars 123 forks source link

[feat]: refactor function names #437

Open vladdoster opened 1 year ago

vladdoster commented 1 year ago

If the feature solves a problem you have, specify it here.

Describe the proposed feature.

Describe alternatives you've considered

Additional context

Related Issues

vladdoster commented 1 year ago

@pschmitt I've linked all open PRs across zdharma-continuum that have these changes.

pschmitt commented 1 year ago

Would be great to share the script you used to rename these, for posterity

mmedum commented 1 year ago

@vladdoster is it correctly understood, that all PRs needs to be merged, for not ending up after updating with this output:

zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:42: command not found: @zinit-register-annex

My system did get the new function name, but by extending ended up throwing command not found on every new terminal. :)

vladdoster commented 1 year ago

@mmedum Are you attempting to test these changes? Or are you hitting this issue on main branch?

mustaqimM commented 1 year ago

@vladdoster I'm getting this after the last update:

$ zi update -p                                                                                                                                                  1m35s
[self-update] updating zinit repository
[self-update] fetching latest changes from main branch
2022-12-17 b979847b Merge branch 'refactor/zinit-function-names' into main
2022-12-16 a72fb83f fix: container build & shell make targets | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-16 14b2cda0 fix: container build & shell make targets | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-16 370808dd fix: container build & shell make targets | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-16 47bd74f8 fix: container build & shell make targets | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-16 f8eb967b fix: container build & shell make targets | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-15 3af321e8 fix: container build & shell make targets | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-15 2b460a74 fix: vim modelines & zsdoc pdf rendering | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-16 0e45493e fix: change prefix `~zi::` to `__zi::` | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-15 75bb7354 fix: file modelines | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-15 dd048964 fix: make target docker cmd flags | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-09 c28580c3 refactor: rename zinit functions | Signed-off-by: Vladislav Doster <mvdoster@gmail.com>

With errors for all sbin functions after starting a new shell:

$ exec zsh
/home/mustaqim/.local/share/zinit/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:21: command not found: @zinit-register-annex
/home/mustaqim/.local/share/zinit/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:26: command not found: @zinit-register-annex
/home/mustaqim/.local/share/zinit/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:32: command not found: @zinit-register-annex
/home/mustaqim/.local/share/zinit/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:37: command not found: @zinit-register-annex
/home/mustaqim/.local/share/zinit/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:42: command not found: @zinit-register-annex
ERROR: Unknown subcommand: `sbinstarship` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
ERROR: Unknown subcommand: `sbinfpp` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
ERROR: Unknown subcommand: `sbin*->deno` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
ERROR: Unknown subcommand: `sbinbin/heroku` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
ERROR: Unknown subcommand: `sbin*->rust-analyzer` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
ERROR: Unknown subcommand: `sbin*->tree-sitter` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
ERROR: Unknown subcommand: `sbinyt-dlp->yt` (it should be one of, e.g.: `load`, `snippet`, `update`, `delete`, …, e.g.: `zinit load username/reponame`) or a for-based command body (i.e.: e.g.: `zinit …ice-spec… for …(plugin or snippet) ID-1 ID-2 ⋯⋯…`). See `help` for a more detailed usage information and the list of the subcommands.
vladdoster commented 1 year ago

@mmedum & @mustaqimM

This was an accident. I accidentally merged this thinking I was on my fork. I have reverted the commit.

To fix, run:


zi delete --all --yes
zi self-update
exec zsh -l
mmedum commented 1 year ago

@mmedum & @mustaqimM

This was an accident. I accidentally merged this thinking I was on my fork. I have reverted the commit.

To fix, run:

zi delete --all --yes
zi self-update
exec zsh -l

Great! Thanks for the quick help 😃

marmelin commented 1 year ago

Hi guys, what if I still have that problem after fresh installation?

❯ source .zshrc
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-as-monitor/z-a-readurl.plugin.zsh:25: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:21: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:26: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:32: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:37: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:42: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-patch-dl/z-a-patch-dl.plugin.zsh:16: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-patch-dl/z-a-patch-dl.plugin.zsh:23: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:19: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:25: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:30: command not found: @zinit-register-annex
/home/user/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:35: command not found: @zinit-register-annex

and even after delete/self-update..

error output from zinit ... ```   ~ ✘  08:19:29 ❯ zi delete --all --yes Done (action executed, exit code: 0)   ~  08:22:17 ❯ zi self-update Updating »»»» ❮ Zi ❯ … From https://github.com/z-shell/zi * branch main -> FETCH_HEAD Already up to date. Compiling »»» ❮ Zi ❯ … Reloading »»» ❮ Zi ❯ …   ~  08:22:23 ❯ exec zsh -l Downloading: romkatv/powerlevel10k… Cloning into '/home/markus/.zi/plugins/romkatv---powerlevel10k'... ⠼ ░▒▓████████ OBJ: 100, PACK: 92/92, COMPR: 100%, REC: 100%, RES: 100% Compiling: powerlevel10k.zsh-theme… ✔ Downloading: zdharma-continuum/zinit-annex-as-monitor… Cloning into '/home/markus/.zi/plugins/zdharma-continuum---zinit-annex-as-monitor'... ⠼ ░▒▓████████ OBJ: 100, PACK: 393/393, COMPR: 100%, REC: 100%, RES: 100% Compiling: z-a-readurl.plugin.zsh… ✔ /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-as-monitor/z-a-readurl.plugin.zsh:25: command not found: @zinit-register-annex Downloading: zdharma-continuum/zinit-annex-bin-gem-node… Cloning into '/home/markus/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node'... ⣟ ░▒▓████████ OBJ: 100, PACK: 620/620, COMPR: 100%, REC: 100%, RES: 100% Compiling: z-a-bin-gem-node.plugin.zsh… ✔ /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:21: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:26: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:32: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:37: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-bin-gem-node/z-a-bin-gem-node.plugin.zsh:42: command not found: @zinit-register-annex Downloading: zdharma-continuum/zinit-annex-patch-dl… Cloning into '/home/markus/.zi/plugins/zdharma-continuum---zinit-annex-patch-dl'... ⡿ ░▒▓████████ OBJ: 100, PACK: 153/153, COMPR: 100%, REC: 100%, RES: 100% Compiling: z-a-patch-dl.plugin.zsh… ✔ /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-patch-dl/z-a-patch-dl.plugin.zsh:16: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-patch-dl/z-a-patch-dl.plugin.zsh:23: command not found: @zinit-register-annex Downloading: zdharma-continuum/zinit-annex-rust… Cloning into '/home/markus/.zi/plugins/zdharma-continuum---zinit-annex-rust'... ⡿ ░▒▓████████ OBJ: 100, PACK: 209/209, COMPR: 100%, REC: 100%, RES: 100% Compiling: z-a-rust.plugin.zsh… ✔ /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:19: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:25: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:30: command not found: @zinit-register-annex /home/markus/.zi/plugins/zdharma-continuum---zinit-annex-rust/z-a-rust.plugin.zsh:35: command not found: @zinit-register-annex ```
vladdoster commented 1 year ago

@marmelin did you get this resolved?

Try:

zinit delete --all --yes
zinit update --reset
exec zsh -l

If that doesn't fix it, you can run:

rm -rf $ZINIT[HOME_DIR]
exec zsh -l
marmelin commented 1 year ago

Hi @vladdoster , I noticed that the brew installation of zinit does not have correct binary in place to use - so I uninstalled it and installed via normal zinit curl command.

Then updated all again zinit self-update .. now it works :heavy_check_mark: .

Thx :+1:

AndydeCleyre commented 8 months ago

I was starting to open a new issue, but this seems to be the same topic, albeit with a slightly different naming issue: I would like to rename all functions that begin with a dash, because they pollute any completions for prefix commands, such as whence, which, watch, doas, etc.

image

image

vladdoster commented 8 months ago

@AndydeCleyre,

This can be resolved with zstyles:

zstyle ':completion:*:functions' ignored-patterns '([-])*'
Screenshot 2023-10-31 at 8 44 53 PM
AndydeCleyre commented 8 months ago

@vladdoster

  1. Thanks! I may do that.
  2. I'm sorry, I mistakenly thought I was in the tracker for fast-syntax-highlighting, but now see that this doesn't belong here.
  3. While I may use that workaround, it is not ideal, because I may actually want to get these functions as completion suggestions, when I'm looking for a function (not an option).