From c17ff5ad37bcac08ada361cf2e1b503004141f67 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Wed, 6 Aug 2014 15:51:18 -0400 Subject: [PATCH] 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. --- zsh/completion/_ag | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zsh/completion/_ag b/zsh/completion/_ag index 699e71d5ea..0d990d6114 100644 --- a/zsh/completion/_ag +++ b/zsh/completion/_ag @@ -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