From 9dc79950d3d9ebdfe09224e27e3af258f7438ae6 Mon Sep 17 00:00:00 2001 From: vapniks Date: Sun, 2 Oct 2016 16:20:55 +0100 Subject: [PATCH] Update comments section of _beet More accurate instructions on how to create a cached completion file (previous instructions where incorrect) --- extra/_beet | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/extra/_beet b/extra/_beet index dd3f6570b..9f20151f7 100644 --- a/extra/_beet +++ b/extra/_beet @@ -3,10 +3,17 @@ # 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) -# You can make it faster in future by saving the generated completion function: which _beet > _beet2 -# to the top of the file add: #compdef beet -# to the bottom of the file add: _beet "$@" -# add this file to your zsh completions directory, and then in your .zshrc file add: compdef _beet2 beet +# You can make it faster in future by creating a cached version: +# 1) perform a query completion with this file (_beet), e.g. do: beet list artist:" +# to create the completion function (takes a few seconds) +# 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. # useful: argument to _regex_arguments for matching any word