vim - How to make Syntastic search for javac config file in project -
i'm using syntastic vim , i've added external libraries classpath (using syntasticjavaceditclasspath
). creates file in current working directory (which project folder). fine. however, whenever restart vim, syntastic seems search .syntastic_javac_config file
in current working directory only, , cwd is, of course, randomly whereever left in last operation. doesn't find file , bunch of incorrect import errors. can syntastic told search file's parents config file? if not, there way of using vim typically works? (i've been using vim couple of months might clueless.)
according the official manual, snippet should solve problem. put in .vimrc
, change javascript
, jscs
, etc. required values
function! findconfig(prefix, what, where) let cfg = findfile(a:what, escape(a:where, ' ') . ';') return cfg !=# '' ? ' ' . a:prefix . ' ' . shellescape(cfg) : '' endfunction autocmd filetype javascript let b:syntastic_javascript_jscs_args = \ get(g:, 'syntastic_javascript_jscs_args', '') . \ findconfig('-c', '.jscs', expand('<afile>:p:h', 1))
Comments
Post a Comment