本文根据 Devhints / Vim-rails 翻译。代码示例及版本范围沿用原文。
关联文件
关联文件
其功能
缩写
类型 (Type) :Rabbrev 查看完整列表。
模型
控制器
视图 (Views)
提取局部视图 (partials)
# from view => app/views/home/_foo_partial.haml
:Rextract home/foo_partial
# from model => app/models/concerns/foo_concern.rb
:Rextract FooConcern
加载文件
App
:Econtroller <file> # app/controllers/*_controller.rb
:Ehelper # app/helpers/*_helper.rb
:Emodel <file> # app/models/*.rb
:Ejob <file> # app/jobs/*_job.rb
:Emailer <file> # app/mailers/*.rb
DB
:Emigration <file> # db/migrations/*.rb
:Eschema # db/schema.rb
Lib
:Elib <file> # lib/*.rb
:Elib # Gemfile
:Etask <file> # lib/tasks/*.rake
Assets
:Estylesheet
:Ejavascript
视图 (Views)
:Eview
:Elayout
测试
:Espec
:Eunittest
# test/{unit,models,helpers}/*_test.rb
# spec/{unit,models,helpers}/*_spec.rb
:Efunctionaltest
# test/{functional,controllers,mailers}/*_test.rb
# spec/{functional,controllers,mailers}/*_spec.rb
:Eintegrationtest
# test/integration/*_test.rb
# spec/{features,requests,integration}/*_spec.rb
# features/*.feature
:Efixtures
:Efunctionaltest
配置
:Einitializer <file> # config/initializers/*.rb
:Elocale # config/locales/*.yml
:Eenvironment # application.rb
:Eenvironment development # config/environments/*.rb
参考资料