rufo-vim


Ⅰ. 插件描述

Ruby format for vim via rufo

Ⅱ. 基本信息

创建日期:  2017-06-26
使用用户:  1
Github星:  46
插件作者:  ruby-formatter

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# rufo-vim

Ruby format for vim via rufo.

Installation

First of all, install rufo via

    $ gem install rufo

Verify it works via

    $ rufo -v

For vim, if you don't have a preferred installation method, I recommend
installing pathogen.vim, and
then simply copy and paste:

cd ~/.vim/bundle
git clone git://github.com/ruby-formatter/rufo-vim.git

Enable in .vimrc

Auto formatting is disabled by default, so you have to enable it in your .vimrc/.gvimrc

" Enable rufo (RUby FOrmat)
let g:rufo_auto_formatting = 1

Next time when you save the file code will be formatted

Partial formatting

For formatting some part of the code select lines with Shift+V and call :Rufo command

Options

g:rufo_auto_formatting - enable/disable auto formatting. Default value: 0 (disabled)

g:rufo_errors_buffer_position - errors buffer position. Possible values: 'top', 'bottom', 'left', 'right'.
Default: 'bottom'

g:rufo_silence_errors - Errors will not be shown if set to 1. Possible values: 0 or 1. Default: 0

Commands

:Rufo - run formatting. In Normal mode - format whole file, in Visual mode - format selected part

:RufoOn - enable auto formatting

:RufoOff - disable auto formatting

:RufoToggle - enable/disable auto formatting

Contributors

Thank you :green_heart:

Help is very welcome!

添加新评论