Ⅰ. 插件描述
A vim plugin which helps to refactor rails based projectsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'sandeepravi/refactor-rails-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'sandeepravi/refactor-rails-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'sandeepravi/refactor-rails-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/sandeepravi/refactor-rails.vim
Ⅳ. 文档说明
# Rails Refactoring Tool for Vim
This is a simple vim plugin which helps in refactoring ruby on rails code.
I have been using vim for quite sometime now and I was quite happy with
rails.vim plus a few other plugins for Ruby and Rails based
projects, until I tried out Redmine. Although, it hogs a lot of memory
and is quite slow, it's features are quite impressive; especially the
"refactor" features. And I like vim and wasn't ready to move to Redmine,
so I decided to write this plugin which will help in refactoring Rails
applications.
Existing Features
vnoremap <leader>riv :RenameInstanceVariable<cr>
vnoremap <leader>rv :RenameLocalVariable<cr>
noremap <leader>ic :IndentFile<cr>
noremap <leader>mf :MoveCurrentFile<cr>
noremap <leader>cf :CopyCurrentFile<cr>
noremap <leader>rc :RenameController<cr>
vnoremap <leader>em :ExtractMethod<cr>
noremap <leader>iv :InlineVariable<cr>
Any of you having a doubt here, vnoremap corresponds to mapping in the
visual mode and the rest are in normal mode. You can map these to any
other keys as per your needs.
Upcoming Features
- Renaming Models
- Move code to callbacks
and quite a few others.
Contributing
Feel free to fork this project and contribute any features. Also, leave
a not in issues in case you have suggestions for any features, bugs etc.
Licencing
Copyright © 2012 Sandeep Ravichandran. Distributed under the same terms as Vim itself. See :help license.