开发者

How to configure stepping-into Rails's core with Vim Exuberant Tags?

While enjoying the flexi开发者_如何学Cbility of Vim Exuberant Tags def navigation in Rails applications, I thought why not go deeper, and have the Rails core source as a low-level reference.

How can I configure Vim to include another tag file, and what code should I map?

Thanks.


You should be able to simply pass your gems directory on the command line the ctags command. ctags takes a list of source files to examine on the command line. For instance if I was using rails 2.3.5 and running ctags from the root of my Rails application:

ctags -R $GEM_HOME/gems/rails-2.3.5/lib/* ./*

If you are using bundler, you could use bundle show to find the path for you. ctags will also let you exclude certain directories using the --exclude flag. Check out the options documentation for more info.


Vim looks for its tag files in the 'tags' option, which is a list of (absolute/relative) paths. Sou in Vim you could do

:set tags+=/path/to/ror/tags

Also see

:help 'tags'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜