Re: [Fish-users] Custom completions ignored in ~/.config/fish/completions

2017-06-02 Thread Kurtis Rader
On Fri, Jun 2, 2017 at 4:14 PM, Marcin Zajączkowski  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.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
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


[Fish-users] Custom completions ignored in ~/.config/fish/completions

2017-06-02 Thread Marcin Zajączkowski
Hi,

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?

Fedora 25, fish-2.3.1-1.fc25.x86_64.

[1] - https://github.com/szpak/gitkurka/blob/master/config

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