Need help with validator.vim?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

maralla
206 Stars 14 Forks MIT License 164 Commits 24 Opened issues

Description

Check syntax on the fly asynchronously.

Services available

!
?

Need anything else?

Contributors list

# 53,957
C
Redis
Vim
Rust
96 commits
# 38,184
Lua
macOS
hammers...
C
14 commits
# 519,405
batch
Ruby
Python
Vim
5 commits
# 145,167
Ruby
oracle
SQLite
fixture...
2 commits
# 75,717
Kotlin
Python
Elixir
syntax-...
2 commits
# 672,507
Shell
HTML
Python
vim-plu...
1 commit
# 30,438
TypeScr...
Neovim
pixi
glsl
1 commit
# 433,855
HTML
CSS
Shell
Vim
1 commit
# 725,922
Python
vim-plu...
Vim
syntax-...
1 commit

Validator

Build Status

Syntax check framework for vim which checks syntax on the fly asynchronously.

Requirements

You should have a relatively new version of vim which supports such features:

job
,
timers
and
lambda
.

Your vim should be compiled with

python
or
python3
.

Validator relies on external syntax checkers, so you need to install the checkers fit for the files you are editting.

Builtin Checkers

  • c/c++,
    clang-tidy
  • python,
    flake8
  • cython,
    cython
  • css,
    csslint
  • javascript,
    jshint
    ,
    eslint
    ,
    jscs
  • ruby,
    mri
    ,
    rubocop
  • json,
    jsonlint
  • lua,
    luac
    ,
    luacheck
  • sh,
    sh
    ,
    shellcheck
  • rst,
    rst2pseudoxml
  • vim,
    vint
    ,
    vimlparser
  • go,
    gofmt
    ,
    golint
    ,
    gometalinter
  • rust,
    cargo check
    (not instant)

Configuration

Select checkers for a file type:

let g:validator_{filetype}_checkers = ['']

" for example, choose eslint to check javascript: let g:validator_javascript_checkers = ['eslint']

To customize error message:

let g:validator_error_msg_format = "[ ● %d/%d issues ]"

To auto open quickfix window:

let g:validator_auto_open_quickfix = 1

To handle file type alias:

let g:validator_filetype_map = {'': ''}

" for example let g:validator_filetype_map = {"python.django": "python"}

Ignore file types:

let g:validator_ignore = ['']

To customize the signs colors, you can use the following groups:

" For syntax errors & warnings
ValidatorErrorSign
ValidatorWarningSign

" For style errors & warnings " (By default, use the same colors as the 2 groups above) ValidatorStyleErrorSign ValidatorStyleWarningSign

To show permanently the sign column and prevent annonying behavior when the sign column appear and then it disappears.

sign

let g:validator_permament_sign = 1

To specify the checker executable path or pass checker arguments manually:

" If not specified `` is `_`.
let g:validator__args = ''
" If not specified `` is `_`.
let g:validator__binary = '/path/to/executable'

" For c/c++ let g:validator_clang_tidy_binary = '/path/to/executable'

" For flake8 let g:validator_python_flake8_args = '--max-line-length=120' let g:validator_python_flake8_binary = '/Users/maralla/.dotfiles/virtualenvs/py27/bin/flake8'

" For rubocop let g:validator_ruby_rubocop_args = '-f s -c .rubocop.yml' let g:validator_ruby_rubocop_binary = '/Users/maralla/.rvm/gems/ruby-2.3.0/bin/rubocop'

Install

$ pack install maralla/validator.vim
Plug 'maralla/validator.vim'

Usage

Validator.vim automatically checks syntax in the background when file content changes, so no need to do any trigger manually. If you do want to do a check manually use this command

ValidatorCheck
. This command is especially useful when you set the file type manually.

Debugging

Enable the debugging with:

let g:validator_debug = 1

The output is logged in plugin installation directory:

e.g.

/path/to/validator.vim/pythonx/validator.log

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.