Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh: rework ZSH completion #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vincentbernat
Copy link

The completion for ZSH is upgraded to the new ZSH completion
system. To work, the file should be placed somewhere in ZSH fpath to
be autoloaded when needed and named _sub.

There are other embedded misc changes:

  • $CURRENT indicate which word is being autocompleted.
  • In ZSH, automatic word splitting is disabled in completion. There
    is no need to quote words.

The completion also handles plugins that are able to complete
args. However, most plugins don't and will complete with a subcommand
instead. I don't think there is an universal solution for this.

I am no ZSH wizard. Take this commit with care (works for me).

The completion for ZSH is upgraded to the new ZSH completion
system. To work, the file should be placed somewhere in ZSH fpath to
be autoloaded when needed and named `_sub`.

There are other embedded misc changes:
 - `$CURRENT` indicate which word is being autocompleted.
 - In ZSH, automatic word splitting is disabled in completion. There
   is no need to quote words.
@mislav
Copy link

mislav commented Dec 19, 2012

Looks good!

@markstos
Copy link
Contributor

markstos commented Jun 2, 2023

I'm not a ZSH user, but given that @mislav seems to have peer-reviewed this, I recommend merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants