From fb9778d3bfedbc234002d52f2798abd9f1e90703 Mon Sep 17 00:00:00 2001 From: Kriegslustig Date: Fri, 16 Sep 2016 22:20:05 +0200 Subject: [PATCH] Implement loading of local flow-bin --- plugin/flow.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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