首页 > 其他分享 >vim rails 操作翻译

vim rails 操作翻译

时间:2023-01-08 23:35:04浏览次数:56  
标签:翻译 users Rails vim controller rails help

rails.vim

This is a massive (in a good way) Vim plugin for editing Ruby on Rails
applications.

  • Easy navigation of the Rails directory structure. gf considers
    context and knows about partials, fixtures, and much more. There are
    two commands, :A (alternate) and :R (related) for easy jumping
    between files, including favorites like model to schema, template to
    helper, and controller to functional test. Commands like :Emodel,
    :Eview, :Econtroller, are provided to :edit files by type, along
    with S, V, and T variants for :split, :vsplit, and
    :tabedit. Throw a bang on the end (:Emodel foo!) to automatically
    create the file with the standard boilerplate if it doesn't exist.
    :help rails-navigation

  • Enhanced syntax highlighting. From has_and_belongs_to_many to
    distance_of_time_in_words, it's here.

  • Interface to the rails command. Generally, use :Rails console to
    call rails console. Many commands have wrappers with additional features:
    :Generate controller Blog generates a blog controller and loads the
    generated files into the quickfix list, and :Runner wraps rails runner
    and doubles as a direct test runner. :help rails-exec

  • Default task runner. Use :Rails (with no arguments) to run the current
    test, spec, or feature. Use :.Rails to do a focused run of just the
    method, example, or scenario on the current line. :Rails can also run
    arbitrary migrations, load individual fixtures, and more.
    :help rails-default-task

  • Partial and concern extraction. In a view, :Extract {file}
    replaces the desired range (typically selected in visual line mode)
    with render '{file}', which is automatically created with your
    content. In a model or controller, a concern is created, with the
    appropriate include declaration left behind.
    :help rails-:Extract

  • Fully customizable. Define "projections" at the global, app, or gem
    level to define navigation commands and override the alternate file,
    default rake task, syntax highlighting, and more.
    :help rails-projections.

  • Integration with other plugins. If [dispatch.vim][] is installed, :Rails
    and other command wrappers will use it for asynchronous execution. Users of
    dadbod.vim and
    dbext get easy access to
    their application's database. Users of
    abolish.vim get pluralize and
    tableize coercions, and users of [bundler.vim][] get a smattering of
    features. :help rails-integration

如果你要找一个文件

:Rfind routes.rb

如果你想打开一个model

:Rmodel user

如果你想打开一个conotroller

:Rcontroller users
:Rcont users

如果你想打开一个view

:Rview users/index
:Rview users/_user

如果你的当前窗口的文件是在app/views/users/下的话

:Rview show #相当于 :Rview users/show

如果你当前光标是controller的index方法中,直接按 R 可以中转到视图文件 index.html.erb中

其它的方法如

:Rserver #启动服务器
:Rserver! #停止服务器
:Rjavascript js_name #打开js文件

还有很多,输入帮助命令自己看吧

:help rails

标签:翻译,users,Rails,vim,controller,rails,help
From: https://www.cnblogs.com/cloudhan/p/17035741.html

相关文章

  • vim 新增的一些操作
    ,回车禁用高亮显示,bd关闭所有buffer,ba关闭所有标签,l下一个buffer,h前一个buffer标签快捷,tn新建tab页签,to新建页签隐藏其他页签,tc关闭标签,tm......
  • 使用.vimrc配置vim
    使用.vimrc配置vim。11"语法高亮22syntaxon3344"主题色55colorschemedelek"想要看vim自带的主题,在非编辑模式下:colorscheme,然后......
  • Gvim基础操作(正则表达式)-02
    Gvim正则表达式正则表达式在linux中使用非常广泛。主要是进行一些替换,在编写脚本的时候都会使用到。gvim、perl、sed、tcl中都会使用到。Gvim正则表达式的使用搜索命令......
  • Gvim基础操作-01
    Gvim基础操作进行代码或者是文本、脚本都要使用到文本编辑工具。vi是visual的缩写,其意为可视化。它是Unix系统文本编辑的标准工具。利用光标在屏幕上的移动,用户可以方便......
  • 2023 0107 关于英语思维之翻译
    在英语学习过程中,很关键的一个因素,就是形成英语思维.你能够熟练的使用合适的单词,短语,加上正确的时态,以及句子结构,构成一个正确的句子.要想构成一个或者说出来一个......
  • vim删除行首数字
    简介: :1,$s/^[0-9]\{1,\}//g:%s/^[0-9]\{1,\}//g:18,200s/^/#/g:19,28s/^#//g:1,$s/^[0-9]\{1,\}//g:%s/^[0-9]\{1,\}//g:18,200s/^/#/g:19,28s/^#//g......
  • 【转载】 免费试用谷歌的翻译接口
    PS:转载注解,由于近日实验室派我这个博六延期的老家伙去北京计算所做开发工作,甚感毕业无望,满心忧虑,但是苦于导师的“不干就退学”的警告,想想即使花上一年干完这个项目如......
  • VIM 插件一些设置
    "ModeSettingslet&t_SI.="\e[5q""SI=INSERTmodelet&t_SR.="\e[4q""SR=REPLACEmodelet&t_EI.="\e[1q""EI=NORMALmode(ELSE)inoremapjjsetnul......
  • bootstrap-select,selectpicker 用法详细:通过官方文档翻译
    bootstrap-select,selectpicker用法详细:通过官方文档翻译 用过selectpicker的都说好~但是网上中文的教程又找不到比较完整的用法,于是去官网看了下顺便弄过来翻译一......
  • cuda gdb文档翻译
    3-gettingstarted3.1设置cuda-gdb的调试环境3.1.1临时文件存放位置Bydefault,CUDA-GDBuses/tmpasthedirectorytostoretemporaryfiles.Toselectadif......