diff --git a/plugin/flow.vim b/plugin/flow.vim index f0ebd5f..24367f9 100644 --- a/plugin/flow.vim +++ b/plugin/flow.vim @@ -24,7 +24,13 @@ if !exists("g:flow#qfsize") let g:flow#qfsize = 1 endif if !exists("g:flow#flowpath") - let g:flow#flowpath = "flow" + " Search for a local version of flow + let s:npm_local_flowpath = finddir("node_modules", ".;") . "/.bin/flow" + if filereadable(s:npm_local_flowpath) + let g:flow#flowpath = s:npm_local_flowpath + else + let g:flow#flowpath = "flow" + endif endif if !exists("g:flow#timeout") let g:flow#timeout = 2