免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1133 | 回复: 0
打印 上一主题 下一主题

rail.vim 常用命令 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-14 15:24 |只看该作者 |倒序浏览

:Rake 这个好记
:Redit 任意文件,相对路径
: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 ~
’sh*ared/sidebar’ %>
=>    app/views/shared/_sidebar.rhtml
=>   public/stylesheets/scaffold.css
class BlogController    app/controllers/application.rb
class ApplicationController    …/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
:Rhelper
:Rview
:Rlayout
:Rapi
:Rfunctionaltest
:Rstylesheet
:Rjavascript
:Rplugin
:Rlib
:Rtask
:Rintegrationtest
一个超强的:Rcommand,不介绍了,看help
:Rscript
:Rconsole
:Rgenerate
:Rserver
:Rserver! 强制运行,杀掉前面那个,相当于重启
重构:
:Rextract 简单说就是把rhtml中的一段提出来,变成子页面
项目结构
:Rproject 看上去有个左边项目结构树
surroud: 这个不是命令,而是一个插件,装好后就可以在rhtml中自动关闭
taglist: 这个插件相当于outline,但是它可以同时放多个文件
NERD_tree:这个插件就是浏览文件,有点项目的感觉


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/86670/showart_2149082.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP