2

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?

Bigfoot11
  • 911
  • 2
  • 11
  • 25
user3071121
  • 605
  • 2
  • 8
  • 12
  • if it does not work, it means that Syntastic is not properly installed. – zmo Mar 08 '15 at 17:00
  • 1
    Both seem to work fine on my machine. What did you do, what did you expect to happen, and what happened instead? What is the output of `:nmap sc`? Does your `nmap` gets executed before or after syntastic is loaded? – lcd047 Mar 08 '15 at 17:00
  • @user3071121 I have the same problem, did you ever find a solution? – Functino Jun 18 '15 at 01:58

1 Answers1

1

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.

Marcus Buffett
  • 1,289
  • 1
  • 14
  • 32