Skip to content

Instantly share code, notes, and snippets.

@nelsonsar
Last active December 19, 2015 15:28
Show Gist options
  • Save nelsonsar/5976086 to your computer and use it in GitHub Desktop.
Save nelsonsar/5976086 to your computer and use it in GitHub Desktop.
This is a script for update ctags and put a tags.{git_base_dir} on the folder that you specify. It will also search for a .srclist in your home folder, for PHP developers is nice to put your include_path for PEAR.Thanks to @henriquemoody for bash support!
#!/bin/bash
ctags -R --exclude=".git" \
-h '.php' \
--languages=-javascript,sql \
--totals=yes \
--tag-relative=yes \
--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/" \
-f vim.tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment