Git hooks, ctags & Rails

Small adjustment to Tim Pope’s outstanding Effortless Ctags with Git:

To get ctags to also index all bundled gems (including Rails), make the following change to the ctags hook


git ls-files | \
  ctags --tag-relative -L - -f"$dir/$$.tags" --languages=-javascript,sql


ctags --recurse --tag-relative -f"$dir/$$.tags" --languages=-javascript,sql `bundle show --paths` `git ls-files`

After triggering the hook, the tags file takes a few seconds to generate in the background – have patience 🙂


2 thoughts on “Git hooks, ctags & Rails

  1. Amir says:

    ctags –recurse –tag-relative -f”$dir/$$.tags” –languages=-javascript,sql `bundle show –paths` `git ls-files`

    { bundle show –paths; git ls-files; } | \
    ctags –recurse –tag-relative -f”$dir/$$.tags” –languages=-javascript,sql

    … to handle spaces in file names the same way Tim’s script did.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: