I have installed python-mode in VIM. But I also have Syntastic installed. Since both do syntax checking, is there going to be a conflict? How can I turn off Syntastic for Python files?
Thanks for any help
To expand on @abjuk's answer, you can disable based on file extension with:
let g:syntastic_ignore_files = ['\.py$']
This will only work for files that end in .py
, though. It won't work for other files in where Vim thinks that filetype=python
. For example, a file that starts with a shebang like #!/usr/bin/env python
will still put Vim into python mode.
Syntastic also supports syntastic_mode_map
(see :h syntastic_mode_map
), which the docs seem to indicate should allow disabling based on the filetype, but I can't get it to work.
Another option is to leave Syntastic enabled, and disable python-mode's syntax checking:
let g:pymode_lint = 0
This is what I use, because I prefer Syntastic. It resolves the conflict, although it isn't exactly what you asked.
This is answered in the manual (see :help syntastic-pymode
):
Syntastic can be used along with the 'python-mode' Vim plugin (see https://github.com/klen/python-mode). However, they both run syntax checks by default when you save buffers to disk, and this is probably not what you want. To avoid both plugins opening error windows, you can either set passive mode for python in syntastic (see
syntastic_mode_map
), or disable lint checks in 'python-mode', by settingpymode_lint_on_write
to 0. E.g.:
let g:pymode_lint_on_write = 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With