- Pressing
gf
is usually a good shortcut to open a file:- on model names (as symbols or class names) will take you to the file
- on partial calls it will open the partial
- Pressing
:R<tab>
will give you all available commands :R
commands can be customized, see these custom extensions for Backbone
To use CTags in Vim, it's enough to run the command from the project root
/usr/local/bin/ctags -R --exclude=.git --exclude=log --exclude='*.js' --exclude=public --exclude=tmp -f ./.tags *
Note that the homebrew version is being used here.
It's also good to set the right settings in Vim:
" Tags
let Tlist_Ctags_Cmd = "/usr/local/bin/ctags -R --exclude=.git --exclude=log --exclude='*.js' -f ./.tags *"
set tags+=.tags"
Both settings assume a .tags
file inside the project, which you can add to .gitignore
Tag navigation can be activated by pressing ctrl-]
on a method, typing :ta query
or using ctrl-p tag search.
Tags are useful with jumps, a typical workflow can be pressing ctrl-]
on a cucumber step to see its definition, then pressing ctrl-o
to go back to the feature file.