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/compiler/perlcritic.vim | 11 +++++++++++ vim/compiler/vint.vim | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 vim/compiler/perlcritic.vim create mode 100644 vim/compiler/vint.vim (limited to 'vim/compiler') 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