Ⅰ. 插件描述
rails.vim helper for generating SQL migrations for Rails projectsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'jbranchaud/vim-rails-sql-migrations'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'jbranchaud/vim-rails-sql-migrations'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'jbranchaud/vim-rails-sql-migrations'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/jbranchaud/vim-rails-sql-migrations
Ⅳ. 文档说明
# rails-sql-migrations.vim
rails.vim helper for generating SQL migrations for Rails projects
I built this for all my friends at Hashrocket so
that they never again have to manually type out the up and down methods
with their respective heredocs.
This plugin requires and works with therails.vim plugin to provide a set of
file commands for creating and opening SQL migrations.
It works just like the :Emigration helper, but, when used to create a new
migration, generates a SQL-based migration.
:Esql create_posts_table!which generates and opens:
# db/migrate/20161016190650_create_posts_table.rb
class CreatePostsTable < ActiveRecord::Migration
def up
execute <<-SQL
SQL
end
def down
execute <<-SQL
SQL
end
endThis plugin works with all the rails.vim commands you are used to::Ssql, :Vsql, etc. It also provides tab completion of your project's
existing migrations.