vim-rubocop


Ⅰ. 插件描述

Run rubocop async

Ⅱ. 基本信息

创建日期:  2017-04-01
使用用户:  1
Github星:  7
插件作者:  Rajesh Sharma

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'deepredsky/vim-rubocop-be-who-we-are'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'deepredsky/vim-rubocop-be-who-we-are'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'deepredsky/vim-rubocop-be-who-we-are'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Vim RuboCop

VIM plugin to run RuboCop and displays the results in a quickfix window. Most of this is same as Vim Rubocop plugin. I just wanted to add additional features while learning vimscript

Usage

:RuboCop " Runs rubocop on the current buffer
:RuboCopAll " Runs rubocop on the whole project
:RuboCopAll --display-cop-names" Run rubocop with custom options
:RuboCopFix " Fix rubocop issues for current file. This will not be async.

By default it will look at Gemfile and use bundle exec rubocop --format emacs
if rubocop is specified in the Gemfile, otherwise it will fallback to using
rubocop --format emacs. This can be overridden

let g:rubocop_cmd = "bundle exec rubocop --rails --display-cop-names"

NOTE that emacs formatter is required for this plugin to populate quickfix list

TODO

  • [x] Run rubocop on whole project
  • [x] Handle bundled rubcop
  • [x] Pass custom args to rubocop
  • [x] Run rubocop async
  • [ ] Support for vim < 8 ( given up on this, sorry :( )

添加新评论