Syntastic is a fantastic syntax checker for Vim editor.
I learned about this recently, and tried this out for my favoraite language Haskell. And, I have also learned that Vim now has a resonable way of managing Vim packages using pathogen. I followed the instructions on the following blog for installing pathogen:
When you install syntastic using pathogen, which is the recommended way, things will just work (at least in linux).
Syntastic supports Haskell using ghc-mod package, which of course requires ghc installed. Major linux distros are likey to have a distro packge for ghc-mod and ghc. I use the Debian unstable, which has ghc-mod and ghc packages by distro.
When you try out sytastic for Haskell, standard haskell scripts of hs suffix will work but the lierate haskell scripts of lhs suffix will not. The solution for this is to simply make a symbolic link of lhaskell.vim from haskell.vim in the syntax_checker directory as follows:
kyagrd@kyahp:~/.vim/bundle/syntastic/syntax_checkers$ ls -al *haskell*.vim
-rw-r–r– 1 kyagrd kyagrd 1694 4월 21 15:14 haskell.vim
lrwxrwxrwx 1 kyagrd kyagrd 11 4월 21 16:24 lhaskell.vim -> haskell.vim
Then, I got syntastic working for literate haskell scripts as well.
Tips that I use.
- :SyntasticToggleMode to enable/disable syntastic.