From a72f5ccd9a0ac3c2333443964b9219d6cf8c80c1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 17:31:41 +1300 Subject: Remove 'shellpipe' setting This seems to be necessary for a location-list-based :lmake system to work for checking and linting. I'll figure out exactly why a bit later. --- vim/config/command.vim | 3 --- 1 file changed, 3 deletions(-) diff --git a/vim/config/command.vim b/vim/config/command.vim index e6679b84..b96987cd 100644 --- a/vim/config/command.vim +++ b/vim/config/command.vim @@ -4,9 +4,6 @@ set history=2000 " Always tell me the number of lines changed by a command set report=0 -" Don't write the output of :make to the terminal -set shellpipe=> - " Command-line based features if has('cmdline_info') -- cgit v1.2.3 From fdd2222ddf85113cc9820c1f4b1b07efac4703aa Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 17:32:37 +1300 Subject: Adapt sh check/lint to use :lmake This opens the error list in the location list for the error list if there were any. It seems to work well. --- vim/after/ftplugin/sh/check.vim | 26 +++++++++++++++++++++----- vim/after/ftplugin/sh/lint.vim | 26 +++++++++++++++++++++----- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/vim/after/ftplugin/sh/check.vim b/vim/after/ftplugin/sh/check.vim index 334ec1db..72ebd613 100644 --- a/vim/after/ftplugin/sh/check.vim +++ b/vim/after/ftplugin/sh/check.vim @@ -11,15 +11,31 @@ endif " Choose checker based on shell family if exists('b:is_bash') - let b:sh_check = 'write !bash -n' + let b:sh_check_makeprg = 'bash -n %:S' elseif exists('b:is_kornshell') - let b:sh_check = 'write !ksh -n' + let b:sh_check_makeprg = 'ksh -n %:S' else - let b:sh_check = 'write !sh -n' + let b:sh_check_makeprg = 'sh -n %:S' endif +let b:sh_check_errorformat = '%f: %l: %m' if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin - \ . '|unlet b:sh_check' + \ . '|unlet b:sh_check_makeprg' + \ . '|unlet b:sh_check_errorformat' +endif + +" Build function for checker +if !exists('*s:ShCheck') + function s:ShCheck() + let l:save_makeprg = &l:makeprg + let l:save_errorformat = &l:errorformat + let &l:makeprg = b:sh_check_makeprg + let &l:errorformat = b:sh_check_errorformat + lmake! + let &l:makeprg = l:save_makeprg + let &l:errorformat = l:save_errorformat + lwindow + endfunction endif " Set up a mapping for the checker, if we're allowed @@ -28,7 +44,7 @@ if !exists('g:no_plugin_maps') && !exists('g:no_sh_maps') " Define a mapping target nnoremap \ ShCheck - \ :execute b:sh_check + \ :call ShCheck() if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap ShCheck' diff --git a/vim/after/ftplugin/sh/lint.vim b/vim/after/ftplugin/sh/lint.vim index 8745a31e..2381e6e2 100644 --- a/vim/after/ftplugin/sh/lint.vim +++ b/vim/after/ftplugin/sh/lint.vim @@ -11,15 +11,31 @@ endif " Choose linter based on shell family if exists('b:is_bash') - let b:sh_lint = 'write !shellcheck -e SC1090 -s bash -' + let b:sh_lint_makeprg = 'shellcheck -e SC1090 -f gcc -s bash %:S' elseif exists('b:is_kornshell') - let b:sh_lint = 'write !shellcheck -e SC1090 -s ksh -' + let b:sh_lint_makeprg = 'shellcheck -e SC1090 -f gcc -s ksh %:S' else - let b:sh_lint = 'write !shellcheck -e SC1090 -s sh -' + let b:sh_lint_makeprg = 'shellcheck -e SC1090 -f gcc -s sh %:S' endif +let b:sh_lint_errorformat = '%f:%l:%c: %m [SC%n]' if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin - \ . '|unlet b:sh_lint' + \ . '|unlet b:sh_lint_makeprg' + \ . '|unlet b:sh_lint_errorformat' +endif + +" Build function for checker +if !exists('*s:ShLint') + function s:ShLint() + let l:save_makeprg = &l:makeprg + let l:save_errorformat = &l:errorformat + let &l:makeprg = b:sh_lint_makeprg + let &l:errorformat = b:sh_lint_errorformat + lmake! + let &l:makeprg = l:save_makeprg + let &l:errorformat = l:save_errorformat + lwindow + endfunction endif " Set up a mapping for the linter, if we're allowed @@ -28,7 +44,7 @@ if !exists('g:no_plugin_maps') && !exists('g:no_sh_maps') " Define a mapping target nnoremap \ ShLint - \ :execute b:sh_lint + \ :call ShLint() if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap ShLint' -- cgit v1.2.3 From 2c7c641b3255c0b384f6bd89dded1d7054a9345f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 18:00:02 +1300 Subject: Add :lwindow support to Perl check/lint The checker is a bit dicey; I hope that format is reliable. It may turn out to be better to depend on Vi::QuickFix or a similar module. We'll see. --- vim/after/ftplugin/perl/check.vim | 16 +++++++++++++++- vim/after/ftplugin/perl/lint.vim | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/perl/check.vim b/vim/after/ftplugin/perl/check.vim index 6b057c82..ebfbcea6 100644 --- a/vim/after/ftplugin/perl/check.vim +++ b/vim/after/ftplugin/perl/check.vim @@ -9,13 +9,27 @@ if exists('b:undo_ftplugin') \ . '|unlet b:did_ftplugin_perl_check' endif +" Build function for checker +if !exists('*s:PerlCheck') + function s:PerlCheck() + let l:save_makeprg = &l:makeprg + let l:save_errorformat = &l:errorformat + let &l:makeprg = 'perl -c %:S' + let &l:errorformat = '%m at %f line %l.' + lmake! + let &l:makeprg = l:save_makeprg + let &l:errorformat = l:save_errorformat + lwindow + endfunction +endif + " Set up a mapping for the checker, if we're allowed if !exists('g:no_plugin_maps') && !exists('g:no_perl_maps') " Define a mapping target nnoremap \ PerlCheck - \ :write !perl -c + \ :call PerlCheck() if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap PerlCheck' diff --git a/vim/after/ftplugin/perl/lint.vim b/vim/after/ftplugin/perl/lint.vim index 86740c81..61856825 100644 --- a/vim/after/ftplugin/perl/lint.vim +++ b/vim/after/ftplugin/perl/lint.vim @@ -9,13 +9,27 @@ if exists('b:undo_ftplugin') \ . '|unlet b:did_ftplugin_perl_lint' endif +" Build function for linter +if !exists('*s:PerlLint') + function s:PerlLint() + let l:save_makeprg = &l:makeprg + let l:save_errorformat = &l:errorformat + let &l:makeprg = 'perlcritic --quiet --verbose 1 %:S' + let &l:errorformat = '%f:%l:%c:%m' + lmake! + let &l:makeprg = l:save_makeprg + let &l:errorformat = l:save_errorformat + lwindow + endfunction +endif + " Set up a mapping for the linter, if we're allowed if !exists('g:no_plugin_maps') && !exists('g:no_perl_maps') " Define a mapping target nnoremap \ PerlLint - \ :write !perlcritic + \ :call PerlLint() if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap PerlLint' -- cgit v1.2.3 From 83ab42988ea599fdda31df9460b8c13f3a7aa1f1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 22:46:14 +1300 Subject: Use :compiler scripts for makeprg setup I didn't know about :compiler until now. From :help write-compiler-plugin: > A compiler plugin sets options for use with a specific compiler. The > user can load it with the |:compiler| command. The main use is to set > the 'errorformat' and 'makeprg' options. Vim even has "perl" and "tidy" compilers already that seem to work really well. I'll just add in my own and install them. --- Makefile | 6 ++++++ vim/after/ftplugin/perl/check.vim | 3 +-- vim/after/ftplugin/perl/lint.vim | 3 +-- vim/compiler/perlcritic.vim | 11 +++++++++++ vim/compiler/vint.vim | 11 +++++++++++ 5 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 vim/compiler/perlcritic.vim create mode 100644 vim/compiler/vint.vim diff --git a/Makefile b/Makefile index 4d292b46..a899a367 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,7 @@ install-vim-after-syntax \ install-vim-autoload \ install-vim-bundle \ + install-vim-compiler \ install-vim-config \ install-vim-ftdetect \ install-vim-gui \ @@ -495,6 +496,7 @@ install-urxvt: urxvt/ext/select install-vim: install-vim-after \ install-vim-autoload \ install-vim-bundle \ + install-vim-compiler \ install-vim-config \ install-vim-doc \ install-vim-ftdetect \ @@ -529,6 +531,10 @@ install-vim-bundle: install-vim-config -type d -exec sh -c 'mkdir -p -- $(HOME)/."$$1"' _ {} \; -o \ -type f -exec sh -c 'cp -p -- "$$1" $(HOME)/."$$1"' _ {} \; +install-vim-compiler: + mkdir -p -- $(HOME)/.vim/compiler + cp -p -- vim/compiler/*.vim $(HOME)/.vim/compiler + install-vim-config: mkdir -p -- $(HOME)/.vim/config cp -p -- vim/vimrc $(HOME)/.vimrc diff --git a/vim/after/ftplugin/perl/check.vim b/vim/after/ftplugin/perl/check.vim index ebfbcea6..1a3a6dc8 100644 --- a/vim/after/ftplugin/perl/check.vim +++ b/vim/after/ftplugin/perl/check.vim @@ -14,8 +14,7 @@ if !exists('*s:PerlCheck') function s:PerlCheck() let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat - let &l:makeprg = 'perl -c %:S' - let &l:errorformat = '%m at %f line %l.' + compiler perl lmake! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat diff --git a/vim/after/ftplugin/perl/lint.vim b/vim/after/ftplugin/perl/lint.vim index 61856825..8dc4aafe 100644 --- a/vim/after/ftplugin/perl/lint.vim +++ b/vim/after/ftplugin/perl/lint.vim @@ -14,8 +14,7 @@ if !exists('*s:PerlLint') function s:PerlLint() let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat - let &l:makeprg = 'perlcritic --quiet --verbose 1 %:S' - let &l:errorformat = '%f:%l:%c:%m' + compiler perlcritic lmake! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat diff --git a/vim/compiler/perlcritic.vim b/vim/compiler/perlcritic.vim new file mode 100644 index 00000000..381e0df3 --- /dev/null +++ b/vim/compiler/perlcritic.vim @@ -0,0 +1,11 @@ +if exists('current_compiler') + finish +endif +let g:current_compiler = 'tidy' + +if exists(':CompilerSet') != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=perlcritic\ --verbose\ 1\ %:S +CompilerSet errorformat=%f:%l:%c:%m diff --git a/vim/compiler/vint.vim b/vim/compiler/vint.vim new file mode 100644 index 00000000..35a4372e --- /dev/null +++ b/vim/compiler/vint.vim @@ -0,0 +1,11 @@ +if exists('current_compiler') + finish +endif +let g:current_compiler = 'vimlint' + +if exists(':CompilerSet') != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=vint\ %:S +CompilerSet errorformat=%f:%l:%c:\ %m -- cgit v1.2.3 From 932d1d033fb203c4da5f333cf44691dcf43fe7c9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 22:49:18 +1300 Subject: Use :compiler quickfix systems for Vim/HTML lint --- vim/after/ftplugin/html/lint.vim | 15 ++++++++++++++- vim/after/ftplugin/vim/lint.vim | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/html/lint.vim b/vim/after/ftplugin/html/lint.vim index 3ac760ed..103355ab 100644 --- a/vim/after/ftplugin/html/lint.vim +++ b/vim/after/ftplugin/html/lint.vim @@ -11,13 +11,26 @@ if exists('b:undo_ftplugin') \ . '|unlet b:did_ftplugin_html_lint' endif +" Build function for linter +if !exists('*s:HtmlLint') + function s:HtmlLint() + let l:save_makeprg = &l:makeprg + let l:save_errorformat = &l:errorformat + compiler tidy + lmake! + let &l:makeprg = l:save_makeprg + let &l:errorformat = l:save_errorformat + lwindow + endfunction +endif + " Set up a mapping for the linter, if we're allowed if !exists('g:no_plugin_maps') && !exists('g:no_html_maps') " Define a mapping target nnoremap \ HtmlLint - \ :write !tidy -errors -quiet + \ :call HtmlLint() if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap HtmlLint' diff --git a/vim/after/ftplugin/vim/lint.vim b/vim/after/ftplugin/vim/lint.vim index 1b557593..f097ce35 100644 --- a/vim/after/ftplugin/vim/lint.vim +++ b/vim/after/ftplugin/vim/lint.vim @@ -9,13 +9,26 @@ if exists('b:undo_ftplugin') \ . '|unlet b:did_ftplugin_vim_lint' endif +" Build function for checker +if !exists('*s:VimLint') + function s:VimLint() + let l:save_makeprg = &l:makeprg + let l:save_errorformat = &l:errorformat + compiler vint + lmake! + let &l:makeprg = l:save_makeprg + let &l:errorformat = l:save_errorformat + lwindow + endfunction +endif + " Set up a mapping for the linter, if we're allowed if !exists('g:no_plugin_maps') && !exists('g:no_vim_maps') " Define a mapping target nnoremap \ VimLint - \ :write !vint -s /dev/stdin + \ :call VimLint() if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap VimLint' -- cgit v1.2.3 From fb145dfee64fa1c1424d44c914f919a6beed79e1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 22:53:01 +1300 Subject: Add vim/compiler scripts to vint targets --- lint/vim.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lint/vim.sh b/lint/vim.sh index 9af8d203..5c1bbe22 100644 --- a/lint/vim.sh +++ b/lint/vim.sh @@ -1,6 +1,7 @@ set -- \ vim/after \ vim/autoload \ + vim/compiler \ vim/config \ vim/ftdetect \ vim/gvimrc \ -- cgit v1.2.3 From b7c4ed6d716eca106ff0734fb12b3c146fe75132 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 23:32:34 +1300 Subject: Use quickfix window for check/lint --- vim/after/ftplugin/html/lint.vim | 4 ++-- vim/after/ftplugin/perl/check.vim | 4 ++-- vim/after/ftplugin/perl/lint.vim | 4 ++-- vim/after/ftplugin/sh/check.vim | 4 ++-- vim/after/ftplugin/sh/lint.vim | 4 ++-- vim/after/ftplugin/vim/lint.vim | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vim/after/ftplugin/html/lint.vim b/vim/after/ftplugin/html/lint.vim index 103355ab..47ab3766 100644 --- a/vim/after/ftplugin/html/lint.vim +++ b/vim/after/ftplugin/html/lint.vim @@ -17,10 +17,10 @@ if !exists('*s:HtmlLint') let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat compiler tidy - lmake! + make! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat - lwindow + cwindow endfunction endif diff --git a/vim/after/ftplugin/perl/check.vim b/vim/after/ftplugin/perl/check.vim index 1a3a6dc8..92f4b7a6 100644 --- a/vim/after/ftplugin/perl/check.vim +++ b/vim/after/ftplugin/perl/check.vim @@ -15,10 +15,10 @@ if !exists('*s:PerlCheck') let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat compiler perl - lmake! + make! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat - lwindow + cwindow endfunction endif diff --git a/vim/after/ftplugin/perl/lint.vim b/vim/after/ftplugin/perl/lint.vim index 8dc4aafe..0f2f0cd7 100644 --- a/vim/after/ftplugin/perl/lint.vim +++ b/vim/after/ftplugin/perl/lint.vim @@ -15,10 +15,10 @@ if !exists('*s:PerlLint') let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat compiler perlcritic - lmake! + make! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat - lwindow + cwindow endfunction endif diff --git a/vim/after/ftplugin/sh/check.vim b/vim/after/ftplugin/sh/check.vim index 72ebd613..3eaf3f57 100644 --- a/vim/after/ftplugin/sh/check.vim +++ b/vim/after/ftplugin/sh/check.vim @@ -31,10 +31,10 @@ if !exists('*s:ShCheck') let l:save_errorformat = &l:errorformat let &l:makeprg = b:sh_check_makeprg let &l:errorformat = b:sh_check_errorformat - lmake! + make! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat - lwindow + cwindow endfunction endif diff --git a/vim/after/ftplugin/sh/lint.vim b/vim/after/ftplugin/sh/lint.vim index 2381e6e2..7d6e4d75 100644 --- a/vim/after/ftplugin/sh/lint.vim +++ b/vim/after/ftplugin/sh/lint.vim @@ -31,10 +31,10 @@ if !exists('*s:ShLint') let l:save_errorformat = &l:errorformat let &l:makeprg = b:sh_lint_makeprg let &l:errorformat = b:sh_lint_errorformat - lmake! + make! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat - lwindow + cwindow endfunction endif diff --git a/vim/after/ftplugin/vim/lint.vim b/vim/after/ftplugin/vim/lint.vim index f097ce35..243f9463 100644 --- a/vim/after/ftplugin/vim/lint.vim +++ b/vim/after/ftplugin/vim/lint.vim @@ -15,10 +15,10 @@ if !exists('*s:VimLint') let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat compiler vint - lmake! + make! let &l:makeprg = l:save_makeprg let &l:errorformat = l:save_errorformat - lwindow + cwindow endfunction endif -- cgit v1.2.3 From 2f0521a6a2452ea496708df1a138d78e77571df3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 23:33:08 +1300 Subject: Force g:current_compiler removal before check/lint This seems to be necessary for Vim 6. --- vim/after/ftplugin/html/lint.vim | 1 + vim/after/ftplugin/perl/check.vim | 1 + vim/after/ftplugin/perl/lint.vim | 1 + vim/after/ftplugin/vim/lint.vim | 1 + vim/compiler/perlcritic.vim | 2 +- vim/compiler/vint.vim | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/html/lint.vim b/vim/after/ftplugin/html/lint.vim index 47ab3766..c0fdc44f 100644 --- a/vim/after/ftplugin/html/lint.vim +++ b/vim/after/ftplugin/html/lint.vim @@ -16,6 +16,7 @@ if !exists('*s:HtmlLint') function s:HtmlLint() let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat + unlet! g:current_compiler compiler tidy make! let &l:makeprg = l:save_makeprg diff --git a/vim/after/ftplugin/perl/check.vim b/vim/after/ftplugin/perl/check.vim index 92f4b7a6..df90784f 100644 --- a/vim/after/ftplugin/perl/check.vim +++ b/vim/after/ftplugin/perl/check.vim @@ -14,6 +14,7 @@ if !exists('*s:PerlCheck') function s:PerlCheck() let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat + unlet! g:current_compiler compiler perl make! let &l:makeprg = l:save_makeprg diff --git a/vim/after/ftplugin/perl/lint.vim b/vim/after/ftplugin/perl/lint.vim index 0f2f0cd7..48b23091 100644 --- a/vim/after/ftplugin/perl/lint.vim +++ b/vim/after/ftplugin/perl/lint.vim @@ -14,6 +14,7 @@ if !exists('*s:PerlLint') function s:PerlLint() let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat + unlet! g:current_compiler compiler perlcritic make! let &l:makeprg = l:save_makeprg diff --git a/vim/after/ftplugin/vim/lint.vim b/vim/after/ftplugin/vim/lint.vim index 243f9463..2c402964 100644 --- a/vim/after/ftplugin/vim/lint.vim +++ b/vim/after/ftplugin/vim/lint.vim @@ -14,6 +14,7 @@ if !exists('*s:VimLint') function s:VimLint() let l:save_makeprg = &l:makeprg let l:save_errorformat = &l:errorformat + unlet! g:current_compiler compiler vint make! let &l:makeprg = l:save_makeprg diff --git a/vim/compiler/perlcritic.vim b/vim/compiler/perlcritic.vim index 381e0df3..39dcb46f 100644 --- a/vim/compiler/perlcritic.vim +++ b/vim/compiler/perlcritic.vim @@ -1,4 +1,4 @@ -if exists('current_compiler') +if exists('g:current_compiler') finish endif let g:current_compiler = 'tidy' diff --git a/vim/compiler/vint.vim b/vim/compiler/vint.vim index 35a4372e..1fbe3b62 100644 --- a/vim/compiler/vint.vim +++ b/vim/compiler/vint.vim @@ -1,4 +1,4 @@ -if exists('current_compiler') +if exists('g:current_compiler') finish endif let g:current_compiler = 'vimlint' -- cgit v1.2.3 From d7d38582bfbf48aa538aed4d209a30dfbeca3d9f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Nov 2017 23:34:08 +1300 Subject: Use %:S expansion only when available --- vim/compiler/perlcritic.vim | 8 +++++++- vim/compiler/vint.vim | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/vim/compiler/perlcritic.vim b/vim/compiler/perlcritic.vim index 39dcb46f..ec151906 100644 --- a/vim/compiler/perlcritic.vim +++ b/vim/compiler/perlcritic.vim @@ -7,5 +7,11 @@ if exists(':CompilerSet') != 2 command -nargs=* CompilerSet setlocal endif -CompilerSet makeprg=perlcritic\ --verbose\ 1\ %:S +" 7.4.191 is the earliest version with the :S file name modifier, which we +" really should use if we can +if v:version >= 704 || v:version == 704 && has('patch191') + CompilerSet makeprg=perlcritic\ --verbose\ 1\ %:S +else + CompilerSet makeprg=perlcritic\ --verbose\ 1\ % +fi CompilerSet errorformat=%f:%l:%c:%m diff --git a/vim/compiler/vint.vim b/vim/compiler/vint.vim index 1fbe3b62..0dcd4720 100644 --- a/vim/compiler/vint.vim +++ b/vim/compiler/vint.vim @@ -7,5 +7,11 @@ if exists(':CompilerSet') != 2 command -nargs=* CompilerSet setlocal endif -CompilerSet makeprg=vint\ %:S +" 7.4.191 is the earliest version with the :S file name modifier, which we +" really should use if we can +if v:version >= 704 || v:version == 704 && has('patch191') + CompilerSet makeprg=vint\ %:S +else + CompilerSet makeprg=vint\ % +fi CompilerSet errorformat=%f:%l:%c:\ %m -- cgit v1.2.3