Rails Plugin for Vim

xiaoxiao2021-03-01  18

不经意间Vim对Rails的支持已经有飞跃性进步。Tim Pope从5月份开始发布了一个强大的[url=http://www.vim.org/scripts/script.php?script_id=1567]Rails插件[/url]。 在文档的第一句他写道:TextMate may be the latest craze for developing Ruby on Rails applications, but Vim is forever. Vim虽然有文件树,但是对Rails这样的文件夹用起来始终不太方便,现在这个插件提供了智能(哇)文件跳转。跳转命令是gf(别想歪了哈),会根据当前光标位置决定如何跳转。比如(*代表光标位置): [code]link_to "Home", :controller => :bl*og >> app/controllers/blog_controller.rb <%= stylesheet_link_tag :scaf*fold %> >>public/stylesheets/scaffold.css fixtures :pos*ts >>test/fixtures/posts.yml def li*st >> app/views/blog/list.rhtml [/code] 除此而外,该插件还提供了一个工具条,集成了非常多的功能,如图。 [img]http://static.flickr.com/93/213683384_7faba2641e_o.png[/img] 唯一古怪的地方是它的缩写是自己的一套规范,虽然也很简单,但是习惯了textmate那套snippet的话改起来稍微有点费力。 另外,rails插件整合了project插件。打开任意一个rails文件,输入:rproject命令就会自动创建相关project配置,省得自己麻烦了。 相关资源:VIM的Rails编辑插件rails.vim.zip
转载请注明原文地址: https://www.6miu.com/read-3650345.html

最新回复(0)