google / vimdoc

Helpfile generation for vim
Apache License 2.0
291 stars 29 forks source link

Add shell completions by shtab #121

Closed Freed-Wu closed 2 years ago

Freed-Wu commented 2 years ago
vimdoc --print-completion bash | sudo tee /usr/share/bash-completion/completions/vimdoc
vimdoc --print-completion tcsh | sudo tee /etc/profile.d/vimdoc.completion.csh
vimdoc --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_vimdoc
❯ vimdoc -<TAB>
option
--help               show this help message and exit
-h                   show this help message and exit
--print-completion   print shell completion script
--version            show program's version number and exit
❯ vimdoc <TAB>
plugin
scripts/  tests/    vimdoc/
    extras_require={'completion': ['shtab']},
dbarnett commented 2 years ago

@Freed-Wu do you know if it gives self-contained usage details for how to set up the completions that you can access from vimdoc --help or something? Otherwise we might want to add a note to README or something.

Freed-Wu commented 2 years ago

how to set up the completions

The setup method can be seen from https://docs.iterative.ai/shtab/use/. Maybe a note is useful.