ZSH users, here's some good news: after 2 years of silence, the completion function for git-annex has been updated. It now supports all git-annex commands (as of 5.20140517) and has many improvements for completing arguments, remotes, groups, and backends.
To install it:
- make sure your have Python 3 installed (as
python3
somewhere in your$PATH
; tested with 3.4, should work with 3.2+) - get it from GitHub
- copy
_git-annex
to somewhere in your$fpath
(I use$HOME/.config/zsh/completion
) - run
autoload -U path/to/_git-annex
- type
git annex <TAB>
This is very far from being perfect, but it's (IMHO) better than nothing. If you have any issue or suggestion, please tell me!
Many thanks to Frank Terbeck and Valentin Haenel, the original authors of this completion function (source).
When git-annex is built with optparse-applicative version 0.14.0.0, it can generate its own zsh completion file. The Makefile installs that, and it seems to work well.
So, I think that the hand-built zsh completions won't need to be maintained much longer!
-
was typed and completes file names otherwise. The auto generated one (at least the one that is shipped with the Arch Linux package) puts the file names last, which makes it unusable.Well, the code that generates the zsh completions could always be improved. https://github.com/pcapriotti/optparse-applicative/issues
I don't really understand why completing options before filenames makes it unusable. It means that "git-annex tabtabtab" cycles through options first, but if you type part of the filename tab will complete the rest. It does seem that someone else agrees with you though, as they filed this issue: https://github.com/pcapriotti/optparse-applicative/issues/173