DEV Community

Vasily Polovnyov
Vasily Polovnyov

Posted on • Originally published at vasily.polovnyov.ru on

Linting Ruby right in Neovim

For Vim to lint the current file in the background and show errors directly in the editor, you need to do these three steps:

1. Install ALE (async code checker with Language Server Protocol support).

2. Setup it:

" What do we use for linting
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'ruby': ['rubocop']
\}

let g:ale_linters_explicit = 1

" Lint Ruby files with binstub
let g:ale_ruby_rubocop_executable = 'bin/rubocop'

" Tune linter's error and warning signs
let g:ale_sign_error = '\u2022'
let g:ale_sign_warning = '\u2022'

" Let's leave a column for the signs so that the left side of the window doesn't move
let g:ale_sign_column_always = 1
Enter fullscreen mode Exit fullscreen mode

3. You're beatiful!

Top comments (0)