-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathneomake.vim
46 lines (38 loc) · 1.61 KB
/
neomake.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"Neomake config
" Run Neomake on buffer changes
autocmd! BufWritePost * Neomake
let g:neomake_python_enabled_makers = ['flake8']
let g:eslint_path = system('PATH=$(npm bin):$PATH && which eslint')
let g:neomake_javascript_eslint_exe=substitute(g:eslint_path, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
function! StrTrim(txt)
return substitute(a:txt, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
endfunction
let g:neomake_javascript_enabled_makers = ['eslint']
let g:neomake_jsx_enabled_makers = ['eslint']
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if findfile('.flowconfig', '.;') !=# ''
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if g:flow_path != 'flow not found'
let g:neomake_javascript_flow_maker = {
\ 'exe': 'sh',
\ 'args': ['-c', g:flow_path.' --json 2> /dev/null | flow-vim-quickfix'],
\ 'errorformat': '%E%f:%l:%c\,%n: %m',
\ 'cwd': '%:p:h'
\ }
let g:neomake_jsx_flow_maker = {
\ 'exe': 'sh',
\ 'args': ['-c', g:flow_path.' --json 2> /dev/null | flow-vim-quickfix'],
\ 'errorformat': '%E%f:%l:%c\,%n: %m',
\ 'cwd': '%:p:h'
\ }
let g:neomake_javascript_enabled_makers = g:neomake_javascript_enabled_makers + [ 'flow']
let g:neomake_jsx_enabled_makers = g:neomake_jsx_enabled_makers + [ 'flow']
endif
endif
" This is kinda useful to prevent Neomake from unnecessary runs
if !empty(g:neomake_javascript_enabled_makers)
autocmd! BufWritePost * Neomake
endif
" Open the list when there are errors
" 2 keeps the cursor position in place
let g:neomake_open_list = 2