Update comments section of _beet

More accurate instructions on how to create a cached completion file (previous instructions where incorrect)
This commit is contained in:
vapniks 2016-10-02 16:20:55 +01:00 committed by GitHub
parent 8d7a626074
commit 9dc79950d3

View file

@ -3,10 +3,17 @@
# zsh completion for beets music library manager and MusicBrainz tagger: http://beets.radbox.org/ # zsh completion for beets music library manager and MusicBrainz tagger: http://beets.radbox.org/
# NOTE: it will be very slow the first time you try to complete in a zsh shell (especially if you've enable many plugins) # NOTE: it will be very slow the first time you try to complete in a zsh shell (especially if you've enable many plugins)
# You can make it faster in future by saving the generated completion function: which _beet > _beet2 # You can make it faster in future by creating a cached version:
# to the top of the file add: #compdef beet # 1) perform a query completion with this file (_beet), e.g. do: beet list artist:"<TAB>
# to the bottom of the file add: _beet "$@" # to create the completion function (takes a few seconds)
# add this file to your zsh completions directory, and then in your .zshrc file add: compdef _beet2 beet # 2) save a copy of the completion function: which _beet > _beet_cached
# 3) save a copy of the query completion function: which _beet_query > _beet_query_cached
# 4) copy the contents of _beet_query_cached to the top of _beet_cached
# 5) copy and paste the _beet_field_values function from _beet to the top of _beet_cached
# 6) add the following line to the top of _beet_cached: #compdef beet
# 7) add the following line to the bottom of _beet_cached: _beet "$@"
# 8) save _beet_cached to your completions directory (e.g. /usr/share/zsh/functions/Completion)
# 9) add the following line to your .zshrc file: compdef _beet_cached beet
# You will need to repeat this proceedure each time you enable new plugins if you want them to complete properly. # You will need to repeat this proceedure each time you enable new plugins if you want them to complete properly.
# useful: argument to _regex_arguments for matching any word # useful: argument to _regex_arguments for matching any word