主页
http://rails.vim.tpope.net/
Download
http://www.vim.org/scripts/script.php?script_id=1567
Demo
http://v.youku.com/v_show/id_XMjM5MzUyODE2.html
:Rdoc
浏览rails的api
:Rails!
显示rails的脚本
:Rake
Running Rake Tasks
:Redit
任意文件,相对路径
:Redit {file}
#也可以直接跳到想要編輯檔案的特定行
:Redit app/controllers/books_controller.rb:23
:Rlog
日志文件
:Rpreview
打开浏览器,http://localhost:3000
:Rtags
生成一个tag,要求ctags
:Rrefresh
刷新
:Rfind
查文件,可以不写.rb后缀
gf
这个命令超强,根据当前光标处内容跳转到文件,以下是详细例子(*代表光标):
Pos*t.find(:first) => app/models/post.rb
has_many :c*omments => app/models/comment.rb
link_to “Home”, :controller => :bl*og => app/controllers/blog_controller.rb ~
<%= render :partial => ’sh*ared/sidebar’ %> => app/views/shared/_sidebar.rhtml
<%= stylesheet_link_tag :scaf*fold %> => public/stylesheets/scaffold.css
class BlogController < Applica*tionController => app/controllers/application.rb
class ApplicationController < ActionCont*roller::Base => …/action_controller/base.rb
fixtures :pos*ts => test/fixtures/posts.yml
layout :pri*nt => app/views/layouts/print.rhtml
(In the Blog controller)
def li*st => app/views/blog/list.rhtml
:A :R 也是跳文件的
Current file Alternate file Related file ~
model unit test related migration
controller (in method) functional test template (view)
template (view) helper controller (jump to method)
migration previous migration next migration
config/routes.rb config/database.yml config/environment.rb
直接打开
:Rmodel
:Rmigration
:Robserver
:Rfixtures
:Runittest
:Rcontroller
:Rcontroller [{name}]
#這個指令就是等於編輯controller
ex. :Rcontroller tags 就等於vi app/controller/tags_controller.rb
:Rhelper
:Rview
:Rview [[{controller}/]{view}]
#這個指令就是等於編輯controller的view
ex. :Rview tags/index 就等於vi app/views/tags/index.html.erb
:Rlayout
:Rapi
:Rfunctionaltest
:Rstylesheet
:Rjavascript
:Rplugin
:Rlib
:Rtask
:Rintegrationtest
一个超强的:Rcommand
,不介绍了,看help
:Rscript
:Rscript {script} {options}
#這個指令就和下ruby script/{script的名稱}是一樣的
ex.:Rscript generate 就等於ruby script/generate
:Rconsole
:Rgenerate
:Rserver
:Rserver! 强制运行,杀掉前面那个,相当于重启
重构:
:Rextract
简单说就是把rhtml中的一段提出来,变成子页面
项目结构
:Rproject
看上去有个左边项目结构树
surroud:
这个不是命令,而是一个插件,装好后就可以在rhtml中自动关闭<%%>
taglist:
这个插件相当于outline,但是它可以同时放多个文件
NERD_tree:
这个插件就是浏览文件,有点项目的感觉。
分享到:
相关推荐
rails.vim提供了常用的一些命令,可以帮助开发,例如:Rgenerate, Rake, Rfind,RTview等,很方便,也很实用。 安装方法: 拷贝 autoload/rails.vim, plugin/rails.vim, 和 doc/rails.txt 到 ~/.vim 目录. ...
Rails.Recipes.Rails.3.Edition.和源码
With this fully revised new edition, take a holistic view of full-stack development to create usable, high-performing applications with Rails 5. Rails is a great tool for building web applications, ...
Addison.Wesley.Rails.AntiPatterns.Best.Practice.Ruby.on.Rails.Refactoring
rails.vim 这是一个庞大的(很好的方式)Vim插件,用于编辑Ruby on Rails应用程序。 轻松浏览Rails目录结构。 gf考虑上下文,并且知道部分信息,固定装置等等。 有两个命令:A (备用)和:R (相关),可在文件之间...
Ruby on rails.doc Ruby on rails.doc Ruby on rails.doc
Apress.Beginning.Rails.3 Apress.Beginning.Rails.3
Pragmatic.Security.on.Rails.Dec.2009.rar
Ruby.on.Rails.Enterprise.Application.Development
RESTful.Rails.Development.2015.10.pdf
Apress,.Beginning.Google.Maps.Applications.with.Rails.and.Ajax.
Ruby.on.Rails.Tutorial,Learn.Web.Development.with.Rails,Third.Edition-中文版 文字版.pdf 个人收集电子书,仅用学习使用,不可用于商业用途,如有版权问题,请联系删除!
Wiley.Ruby.on.Rails.Bible.Oct.2008
Pragmatic - Agile.Web.Development.with.Rails.4.Sep.2013.pdf
ruby.on.rails.up.and.running
Ruby.on.Rails.Web.Mashup.Projects
Pragmatic.Bookshelf.Rails.for.PHP.Developers
Web开发:Ruby on Rails.pdf
Pragmatic.Bookshelf.Advanced.Rails.Recipes.May.2008