vim-rubyformat


Ⅰ. 插件描述

Automatically reformats/beautifies ruby source code

Ⅱ. 基本信息

创建日期:  2015-12-18
使用用户:  1
Github星:  3
插件作者:  Benjamin Radovsky

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/vim-rubyformat-may-fear-less'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/vim-rubyformat-may-fear-less'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/vim-rubyformat-may-fear-less'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/vim-rubyformat

Ⅳ. 文档说明

UNMAINTAINED

vim-rubyformat is a simple vim plugin, that automatically reformats/beautifies ruby code, either when a ruby file is saved or when ff is pressed whilst in normal mode.

Step 1. In any .rb (ruby) file, when save is called, the RubyFormat() function should automatically be called. It's as simple as that.
Step 2 (Optional). Press ff in normal mode to call the RubyFormat() function.

Settings:
For other keybindings, simply bind :call RubyFormat() to your chosen keybinding in your vimrc file. Example: nnoremap fm :call RubyFormat()<CR>

let g:remove_extra_lines = 2 is the current default, which deletes any extra blank lines more than 2 in a row. Place in vimrc to change the value.

To disable autoformatting on file save, place let g:rubyformat_on_save = 0 in your vimrc file.

添加新评论