2

I am using a .vimrc file cribbed from Github. I am trying to understand what each line is doing. I have installed Syntastic using Vundle. I have typed

:PluginInstall

and it has loaded. But it doesn't seem to work. Looking at the documentation for Syntastic I am supposed to add which syntax checkers I want by putting a line in the .vimrc file like:

let g:syntastic_c_checkers=['c']

However, in the .vimrc I am cribbing there is the following code:

augroup mySyntastic
  au!
  au FileType tex let b:syntastic_mode = "passive"
augroup END

I don't know what this does? Does is automatically pick what syntax checker to use? What does it mean? What is it doing?

1

That sets the mode of checking. From the syntastic docs:

When set to "passive" syntastic only checks when the user calls :SyntasticCheck.

So, instead of automatically running (say, when you save the file), it runs only when you explicitly tell it to. The entire autocommand, then, sets the checking mode to passive for TeX files.

If the checker isn't set elsewhere, then it will use the default (I don't know what that is for TeX files).

| improve this answer | |
  • So if I am going to be using vim to write C, C++, Fortran and Java programs should I hard code each syntax checker? – Jay Dec 9 '18 at 6:45
  • If you have some specific preference. I haven't manually specified any checkers in my config - the defaults usually work fine for me. Where they don't, usually I only need to set some options (say set the standard for C++, or force usage of Python 3, etc.). I'd say try the defaults first before setting manually. – muru Dec 9 '18 at 6:49
  • Thanks. I started messing with it and it looks as if the defaults work – Jay Dec 9 '18 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.