Linting Ruby right in Neovim
Vasily Polovnyov
Posted on April 28, 2022
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
3. You're beatiful!
💖 💪 🙅 🚩
Vasily Polovnyov
Posted on April 28, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.