Source tagging is a powerful source code navigation system that rivals modern IDEs. If you're using Emacs, Vim, or TextMate, you can use ctags for fast code navigation. Here are the steps to set it up.
Step 1: Install ctags
For Mac:
$ sudo port install ctags
Step 2: Create a Tag File
Navigate to your project and generate tags:
$ cd /Users/username/Workspace/rails-project
$ ctags -e -a --Ruby-kinds=+f -o TAGS -R app/ lib/ config/
You can add this to your crontab to regenerate tags automatically (e.g., daily at 11:30am).
Step 3: Using Tags in Your Editor
Emacs
M-. Follow a tag
M-* Jump back to source
Vim
Add this to your ~/.vimrc:
set tags=TAGS;/
Then use these commands:
C-] Go to definition
C-T Jump back from definition
C-W C-] Open definition in horizontal split
TextMate
TextMate can also use ctags files. Configure it to read the TAGS file in your project root. WordPress ID: 1024