Skip to content

Instantly share code, notes, and snippets.

@camilopayan
Created December 28, 2015 18:08
Show Gist options
  • Save camilopayan/b39795f0688185a58ccd to your computer and use it in GitHub Desktop.
Save camilopayan/b39795f0688185a58ccd to your computer and use it in GitHub Desktop.
Universal CTags version of Tim Pope's Effortless CTags for PHP
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
dir="`git rev-parse --git-dir`"
trap 'rm -f "$dir/$$.tags"' EXIT
git ls-files | \
ctags \
--tag-relative=yes \
-L - -f"$dir/$$.tags" \
--languages=php,-javascript,sql
mv "$dir/$$.tags" "$dir/tags"
@camilopayan
Copy link
Author

This is using universal ctags instead of exuberant ctags, since the old ctags' support for new PHP features is pretty much nil.

Also, this is for setting up a PHP project in the style of Tim Pope's Effortless Ctags article which has been a revelation for my vimming 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment