Skip to content

IDE: vim

Jason Karns edited this page Aug 27, 2019 · 12 revisions

Configuration for VIM

ALE

The recommended method for running standardrb within vim is with vim-ale.

To set Standard as your only linter and fixer for Ruby files and thereby preventing conflicts with RuboCop, add these lines to your .vimrc file:

let g:ale_linters = {'ruby': ['standardrb']}
let g:ale_fixers = {'ruby': ['standardrb']}

For automatically fixing on save, add this to your .vimrc:

let g:ale_fix_on_save = 1

vim-ruby

It is quite common for rubyists to use vim-ruby for ruby-aware syntax highlighting and indentation. However, vim-ruby's default indentation conflicts with standardrb. The following will configure vim-ruby to use the same indentation style as standardrb:

let g:ruby_indent_assignment_style = 'variable'

vim-ruby indentation docs

Clone this wiki locally