Matt Styles
Matt Styles

Reputation: 536

Syntastic mode map per checker

Is there any way to separate the syntastic_mode (active vs. passive) depending on the checker? For example, I want it to be active for 'php' (syntax) errors but passive for 'phpcs','phpmd' (style) checkers. Joonty's phpqa plugin can do something like that, but I'd prefer to avoid overlapping plugins and I like syntastic. Thanks!

Upvotes: 2

Views: 948

Answers (2)

lcd047
lcd047

Reputation: 5861

Syntastic modes are per filetype, not per checker. However, you can set php to active, set the list of php checkers to just 'php', and write a command to run phpcs and phpmd explicitly. Perhaps like this:

let g:syntastic_mode_map = { 'mode': 'active' }
let g:syntastic_php_checkers = ['php']
cabbrev syc SyntasticCheck phpcs phpmd

Upvotes: 1

chtenb
chtenb

Reputation: 16184

Syntastic provides a map for that. The following makes syntastic passive for coffee script, but active for any other filetype.

let g:syntastic_mode_map = { 'mode': 'active',
            \ 'active_filetypes': [],
            \ 'passive_filetypes': ['coffee'] }

So the mode entry specifies the standard mode, while the other two entries specify the filetype specific behaviour.

Modify to your needs and put it in your .vimrc.

Upvotes: 2

Related Questions