Reputation: 643
I tried mapping the key to :SyntasticCheck
of Syntastic vim in .vimrc
nmap <leader>sc :SyntasticCheck<CR>
but it doesn't work. Also, when I type this command :SyntasticCheck
into vim command it doesn't work, but when I save file with :w
it works. It checks the syntax & raise errors in bottom window.
Any Ideas?
Upvotes: 2
Views: 983
Reputation: 1389
Syntastic runs the checker on the current file, not the contents of the buffer. If you have a file without syntax errors, add a syntax error, but don't save the file, :SyntasticCheck
will not mark the error because you haven't saved the file. Your mapping is probably working fine, but nothing is getting marked by Syntastic because you haven't saved the file.
Upvotes: 1