On 2017-06-03 01:46, Kurtis Rader wrote:
> On Fri, Jun 2, 2017 at 4:14 PM, Marcin Zajączkowski <msz...@wp.pl> wrote:
>>
>> I want to add completion for some Git aliases [1]. When I put a
>> "complete" line, e.g.
>>> complete -f -c git -n '__fish_git_using_command publish' -a
>> '(__fish_git_unique_remote_branches)'
>>
>> in ~/.config/fish/config.fish it works fine. However, when I put a file
>> "gitkurka.fish" in ~/.config/fish/completions (which is mentioned in the
>> documentation) with the same line it is ignored (a completion doesn't
>> work).
>>
>> Is there anything else I need to do to make it be found?
>>
> 
> Fish only autoloads a completion script when a command with the same name
> is typed. So when you create a completion script named *gitkurka.fish* the
> completions contained within it are only loaded whey you type "gitkurka ".
> Presumably you want to augment the base set of git completions provided by
> fish. What I would do is put your custom git completions in
> ~/.config/fish/completions.fish with the first statement in that script
> being
> 
> source $__fish_datadir/completions/git.fish
> 
> Since your custom completion script inhibits loading any completion script
> found in the directories enumerated by the $fish_complete_path var you need
> to explicitly load the other possible completion scripts.

Thanks for your reply Kurtis. In the meantime I renamed gitkurka.fish to
git.fish (in ~/.config/fish/completions/) and that line was something
that I needed to make it work.

Marcin

-- 
http://blog.solidsoft.info/ - Working code is not enough
https://github.com/szpak/fish-xclip-enhancer - xclip in Fish

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to