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. --- vim/after/ftplugin/perl/check.vim | 3 +-- vim/after/ftplugin/perl/lint.vim | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'vim/after') 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 -- cgit v1.2.3