Skip to content

Instantly share code, notes, and snippets.

@markwu
Last active November 7, 2017 23:04
Show Gist options
  • Save markwu/5430246 to your computer and use it in GitHub Desktop.
Save markwu/5430246 to your computer and use it in GitHub Desktop.
.ctags for php
#!/bin/bash
cd /path/to/framework/library
exec ctags-exuberant -f ~/.vim/mytags/framework \
-h \".php\" -R \
--exclude=\"\.svn\" \
--totals=yes \
--tag-relative=yes \
--PHP-kinds=+cf \
--regex-PHP='/abstract class ([^ ]*)/\1/c/' \
--regex-PHP='/interface ([^ ]*)/\1/c/' \
--regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/'
--PHP-kinds=cfiv
--regex-PHP=/(abstract)?\s+class\s+([^ ]+)/\2/c/
--regex-PHP=/(static|abstract|public|protected|private)\s+(final\s+)?function\s+(\&\s+)?([^ (]+)/\4/f/
--regex-PHP=/interface\s+([^ ]+)/\1/i/
--regex-PHP=/\$([a-zA-Z_][a-zA-Z0-9_]*)/\1/v/
-R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment