diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-06 18:54:19 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-06 18:54:19 +0200 |
commit | bc9757916ed09763d96283ee62dbed58bd713a11 (patch) | |
tree | 07fbb58e9a4f4cbf5206d89f61e4d570e64d2c1a /compiler | |
parent | c6fa4d2bf5eb5301f4d3f123031cf34839a5508d (diff) | |
download | vim-polyglot-bc9757916ed09763d96283ee62dbed58bd713a11.tar.gz vim-polyglot-bc9757916ed09763d96283ee62dbed58bd713a11.zip |
Add all vim filetypes
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/bdf.vim | 26 | ||||
-rw-r--r-- | compiler/context.vim | 58 | ||||
-rw-r--r-- | compiler/cs.vim | 30 | ||||
-rw-r--r-- | compiler/dot.vim | 19 | ||||
-rw-r--r-- | compiler/sass.vim | 34 | ||||
-rw-r--r-- | compiler/tcl.vim | 21 | ||||
-rw-r--r-- | compiler/tex.vim | 71 | ||||
-rw-r--r-- | compiler/tidy.vim | 23 |
8 files changed, 282 insertions, 0 deletions
diff --git a/compiler/bdf.vim b/compiler/bdf.vim new file mode 100644 index 00000000..5bdd9477 --- /dev/null +++ b/compiler/bdf.vim @@ -0,0 +1,26 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'bdf') == -1 + +" Vim compiler file +" Compiler: BDF to PCF Conversion +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2006-04-19 + +if exists("current_compiler") + finish +endif +let current_compiler = "bdf" + +let s:cpo_save = &cpo +set cpo-=C + +setlocal makeprg=bdftopcf\ $* + +setlocal errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m, + \%-Z%p^, + \%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +endif diff --git a/compiler/context.vim b/compiler/context.vim new file mode 100644 index 00000000..9c05b414 --- /dev/null +++ b/compiler/context.vim @@ -0,0 +1,58 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'context') == -1 + +" Vim compiler file +" Compiler: ConTeXt typesetting engine +" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> +" Last Change: 2016 Oct 21 + +if exists("current_compiler") + finish +endif +let s:keepcpo= &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +" If makefile exists and we are not asked to ignore it, we use standard make +" (do not redefine makeprg) +if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) || + \ (!filereadable('Makefile') && !filereadable('makefile')) + let current_compiler = 'context' + " The following assumes that the current working directory is set to the + " directory of the file to be typeset + let &l:makeprg = get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun')) + \ . ' --script context --autogenerate --nonstopmode --synctex=' + \ . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0') + \ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', '')) + \ . ' ' . shellescape(expand('%:p:t')) +else + let current_compiler = 'make' +endif + +let b:context_errorformat = '' + \ . '%-Popen source%.%#> %f,' + \ . '%-Qclose source%.%#> %f,' + \ . "%-Popen source%.%#name '%f'," + \ . "%-Qclose source%.%#name '%f'," + \ . '%Etex %trror%.%#mp error on line %l in file %f:%.%#,' + \ . 'tex %trror%.%#error on line %l in file %f: %m,' + \ . '%Elua %trror%.%#error on line %l in file %f:,' + \ . '%+Emetapost %#> error: %#,' + \ . '! error: %#%m,' + \ . '%-C %#,' + \ . '%C! %m,' + \ . '%Z[ctxlua]%m,' + \ . '%+C<*> %.%#,' + \ . '%-C%.%#,' + \ . '%Z...%m,' + \ . '%-Zno-error,' + \ . '%-G%.%#' " Skip remaining lines + +execute 'CompilerSet errorformat=' . escape(b:context_errorformat, ' ') + +let &cpo = s:keepcpo +unlet s:keepcpo + +endif diff --git a/compiler/cs.vim b/compiler/cs.vim new file mode 100644 index 00000000..4e56feeb --- /dev/null +++ b/compiler/cs.vim @@ -0,0 +1,30 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cs') == -1 + +" Vim compiler file +" Compiler: Microsoft Visual Studio C# +" Maintainer: Yichao Zhou (broken.zhou@gmail.com) +" Previous Maintainer: Joseph H. Yao (hyao@sina.com) +" Last Change: Jul 22, 2019 + +if exists("current_compiler") + finish +endif +let current_compiler = "cs" +let s:keepcpo= &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +CompilerSet errorformat& +CompilerSet errorformat+=%f(%l\\,%v):\ %t%*[^:]:\ %m, + \%trror%*[^:]:\ %m, + \%tarning%*[^:]:\ %m + +CompilerSet makeprg=csc\ %:S + +let &cpo = s:keepcpo +unlet s:keepcpo + +endif diff --git a/compiler/dot.vim b/compiler/dot.vim new file mode 100644 index 00000000..30af567d --- /dev/null +++ b/compiler/dot.vim @@ -0,0 +1,19 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dot') == -1 + +" Vim compiler file +" Compiler: ATT dot +" Maintainer: Marcos Macedo <bar4ka@bol.com.br> +" Last Change: 2004 May 16 + +if exists("current_compiler") + finish +endif +let current_compiler = "dot" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +CompilerSet makeprg=dot\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\" + +endif diff --git a/compiler/sass.vim b/compiler/sass.vim new file mode 100644 index 00000000..8ce9dc84 --- /dev/null +++ b/compiler/sass.vim @@ -0,0 +1,34 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sass') == -1 + +" Vim compiler file +" Compiler: Sass +" Maintainer: Tim Pope <vimNOSPAM@tpope.org> +" Last Change: 2016 Aug 29 + +if exists("current_compiler") + finish +endif +let current_compiler = "sass" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=sass + +CompilerSet errorformat= + \%f:%l:%m\ (Sass::Syntax%trror), + \%ESyntax\ %trror:%m, + \%C%\\s%\\+on\ line\ %l\ of\ %f, + \%Z%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim:set sw=2 sts=2: + +endif diff --git a/compiler/tcl.vim b/compiler/tcl.vim new file mode 100644 index 00000000..11792a1c --- /dev/null +++ b/compiler/tcl.vim @@ -0,0 +1,21 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tcl') == -1 + +" Vim compiler file +" Compiler: tcl +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2004 Nov 27 + +if exists("current_compiler") + finish +endif +let current_compiler = "tcl" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +CompilerSet makeprg=tcl + +CompilerSet errorformat=%EError:\ %m,%+Z\ %\\{4}(file\ \"%f\"\ line\ %l),%-G%.%# + +endif diff --git a/compiler/tex.vim b/compiler/tex.vim new file mode 100644 index 00000000..da14b914 --- /dev/null +++ b/compiler/tex.vim @@ -0,0 +1,71 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tex') == -1 + +" Vim compiler file +" Compiler: TeX +" Maintainer: Artem Chuprina <ran@ran.pp.ru> +" Last Change: 2012 Apr 30 + +if exists("current_compiler") + finish +endif +let s:keepcpo= &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +" If makefile exists and we are not asked to ignore it, we use standard make +" (do not redefine makeprg) +if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') || + \(!filereadable('Makefile') && !filereadable('makefile')) + " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor, + " otherwize the same for global variable with same name, else it will be + " LaTeX + if exists("b:tex_flavor") + let current_compiler = b:tex_flavor + elseif exists("g:tex_flavor") + let current_compiler = g:tex_flavor + else + let current_compiler = "latex" + endif + let &l:makeprg=current_compiler.' -interaction=nonstopmode' +else + let current_compiler = 'make' +endif + +" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with +" addition from Srinath Avadhanula <srinath@fastmail.fm> +CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m, + \%E!\ %m, + \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#, + \%+W%.%#\ at\ lines\ %l--%*\\d, + \%WLaTeX\ %.%#Warning:\ %m, + \%Cl.%l\ %m, + \%+C\ \ %m., + \%+C%.%#-%.%#, + \%+C%.%#[]%.%#, + \%+C[]%.%#, + \%+C%.%#%[{}\\]%.%#, + \%+C<%.%#>%.%#, + \%C\ \ %m, + \%-GSee\ the\ LaTeX%m, + \%-GType\ \ H\ <return>%m, + \%-G\ ...%.%#, + \%-G%.%#\ (C)\ %.%#, + \%-G(see\ the\ transcript%.%#), + \%-G\\s%#, + \%+O(%*[^()])%r, + \%+O%*[^()](%*[^()])%r, + \%+P(%f%r, + \%+P\ %\\=(%f%r, + \%+P%*[^()](%f%r, + \%+P[%\\d%[^()]%#(%f%r, + \%+Q)%r, + \%+Q%*[^()])%r, + \%+Q[%\\d%*[^()])%r + +let &cpo = s:keepcpo +unlet s:keepcpo + +endif diff --git a/compiler/tidy.vim b/compiler/tidy.vim new file mode 100644 index 00000000..f13b3664 --- /dev/null +++ b/compiler/tidy.vim @@ -0,0 +1,23 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tidy') == -1 + +" Vim compiler file +" Compiler: HTML Tidy +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2016 Apr 21 + +if exists("current_compiler") + finish +endif +let current_compiler = "tidy" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S + +" foo.html:8:1: Warning: inserting missing 'foobar' element +" foo.html:9:2: Error: <foobar> is not recognized! +CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%# + +endif |