I have configured the following properly in my .vimrc in the root folder of a project to keep syntastic settings Project specific.

But still Syntastic throws errors saying "No Such File or Directory"

Directory Structure


.vimrc Contents

let g:syntastic_c_include_dirs = ['/home/pydi.k/Project/include/']

foo.c shows a "foo.h no such file or directory"

Bottom Line - I want to configure syntastic so that it looks for custom made header files at locations I point to.

  • Why do you think adding two empty directories to g:syntastic_c_include_dirs will accomplish anything useful?
    – lcd047
    Jul 13, 2015 at 9:30
  • @lcd047 I mentioned properly referring to directory Locations starting with /home/username/directorylocation was mentioned.
    – b1tchacked
    Jul 13, 2015 at 9:32
  • Right, you did. What I'm asking is why do you think that's the "proper" way of doing it.
    – lcd047
    Jul 13, 2015 at 9:38
  • github.com/scrooloose/syntastic/issues/70 I have referred to this link to understand it as the correct of way doing it. Please suggest, if you i need to add other options as well to get syntastic working properly.
    – b1tchacked
    Jul 13, 2015 at 10:04
  • @lcd047 In additioon to that, I have tried the following as well by having seperate config file for syntastic and configuring it. Reference - stackoverflow.com/questions/16622992/…. I am guessing that i am missing something fundamental.
    – b1tchacked
    Jul 13, 2015 at 10:49

1 Answer 1


The problem is not in Configuring Syntastic but rather letting Vim load the .vimrc file in the root directory of your project. The following will solve the problem and ensure that you load the .vimrc before Syntastic checks for errors.

  • After loading vim, explicitly run the command :so location/to/.vimrc

  • Configuring your central .vimrc to load the local .vimrc file from wherever you are launching vim would be a headache as you should carefully always launch it from the root of the project. Instead add this line to the central .vimrc: so .vimrc

  • Use the plugin localrc.

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.