Skip to content

Instantly share code, notes, and snippets.

@bronzehedwick
Created November 13, 2019 16:54
Show Gist options
  • Save bronzehedwick/a241ff0eb9ea6a34954e060a01ba7834 to your computer and use it in GitHub Desktop.
Save bronzehedwick/a241ff0eb9ea6a34954e060a01ba7834 to your computer and use it in GitHub Desktop.
Copying tpope's updated git ctags file
#!/bin/sh
set -e
if [ -d doc -a \( -d autoload -o -d ftdetect -o -d plugin \) ]; then
nohup vim -u NONE -c 'helptags doc' -cq >/dev/null 2>&1 </dev/null &
fi
optfiles=`git ls-files -oc --directory -- .ctags '*/.ctags'`
IFS='
'
for optfile in ${optfiles:-./fake}; do
(
unset GIT_DIR GIT_WORK_TREE
tmpfile=`mktemp ${TMPDIR:-/tmp}/tags.XXXXXXXXXX~`
cd `dirname $optfile`
trap 'rm -f $tmpfile' EXIT INT TERM
git ls-files | ctags -L - -f $tmpfile "$@"
mv $tmpfile tags
)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment