Improve ag tab completion

* Remove unnecessary `uniq`
* Look for tags in tmp/tags or .git/tags
* Send errors to /dev/null if the file(s) do not exist

See http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html for an
explanation behind the reasoning for .git/tags.
This commit is contained in:
Joshua Clayton 2014-08-06 15:51:18 -04:00
parent 9a2cb782b1
commit c17ff5ad37

View file

@ -1,9 +1,7 @@
#compdef ag
if (( CURRENT == 2 )); then
if [[ -a tmp/tags ]]; then
compadd $(cut -f 1 tmp/tags | uniq)
fi
compadd $(cut -f 1 tmp/tags .git/tags 2>/dev/null)
else;
_files
fi