Recursively add directories from a project with *.h in them to c_include_dirs #376

Diablo-D3 opened this Issue Oct 6, 2012 · 1 comment


None yet

2 participants


This does this, but its rather ugly.

au FileType c,cpp let g:syntastic_c_include_dirs=split(system("find . -print0 -iname *.h | xargs -0 -r -n 1 dirname | grep -v .git | sort -u"), '\n')

I'm using vim-rooter, so this seems to work.


Just like you already said your approach is rather ugly and only works on unix. But the option g:syntastic_c_include_dirs enables you to even use your workaround.

Nonetheless I think of implementing something similar using viml with findfile(), finddir() and the like and making it optional. I will link to this issue as soon as I have something worth publishing.

@kongo2002 kongo2002 closed this Oct 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment