From bbee246aaeb7fb689c7a2ae2bb911e34cabe7b00 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 14 Oct 2020 23:01:53 +0200 Subject: Add and fix tests from upstream vim --- ftplugin/Dockerfile.vim | 37 ------------------------------------- ftplugin/make.vim | 37 +++++++++++++++++++++++++++++++++++++ ftplugin/sbt.vim | 19 +++++++++++++++++++ ftplugin/xf86conf.vim | 23 +++++++++++++++++++++++ 4 files changed, 79 insertions(+), 37 deletions(-) delete mode 100644 ftplugin/Dockerfile.vim create mode 100644 ftplugin/make.vim create mode 100644 ftplugin/sbt.vim create mode 100644 ftplugin/xf86conf.vim (limited to 'ftplugin') diff --git a/ftplugin/Dockerfile.vim b/ftplugin/Dockerfile.vim deleted file mode 100644 index 85fb1ee5..00000000 --- a/ftplugin/Dockerfile.vim +++ /dev/null @@ -1,37 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1 - -" Define comment string -setlocal commentstring=#\ %s - -" Enable automatic comment insertion -setlocal formatoptions+=cro - -function! DockerfileReplaceInstruction(original, replacement) - let syn = synIDtrans(synID(line("."), col(".") - 1, 0)) - if syn != hlID("Comment") && syn != hlID("Constant") && strlen(getline(".")) == 0 - let word = a:replacement - else - let word = a:original - endif - let g:UnduBuffer = a:original - return word -endfunction - -inoreabbr from =DockerfileReplaceInstruction("from", "FROM") -inoreabbr maintainer =DockerfileReplaceInstruction("maintainer", "MAINTAINER") -inoreabbr run =DockerfileReplaceInstruction("run", "RUN") -inoreabbr cmd =DockerfileReplaceInstruction("cmd", "CMD") -inoreabbr label =DockerfileReplaceInstruction("label", "LABEL") -inoreabbr expose =DockerfileReplaceInstruction("expose", "EXPOSE") -inoreabbr env =DockerfileReplaceInstruction("env", "ENV") -inoreabbr add =DockerfileReplaceInstruction("add", "ADD") -inoreabbr copy =DockerfileReplaceInstruction("copy", "COPY") -inoreabbr entrypoint =DockerfileReplaceInstruction("entrypoint", "ENTRYPOINT") -inoreabbr volume =DockerfileReplaceInstruction("volume", "VOLUME") -inoreabbr user =DockerfileReplaceInstruction("user", "USER") -inoreabbr workdir =DockerfileReplaceInstruction("workdir", "WORKDIR") -inoreabbr arg =DockerfileReplaceInstruction("arg", "ARG") -inoreabbr onbuild =DockerfileReplaceInstruction("onbuild", "ONBUILD") -inoreabbr stopsignal =DockerfileReplaceInstruction("stopsignal", "STOPSIGNAL") - -endif diff --git a/ftplugin/make.vim b/ftplugin/make.vim new file mode 100644 index 00000000..18d69dc8 --- /dev/null +++ b/ftplugin/make.vim @@ -0,0 +1,37 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'make') == -1 + +" Vim filetype plugin file +" Language: Make +" Maintainer: Bram Moolenaar +" Last Change: 2019 Apr 02 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl et< sts< fo< com< cms< inc<" + +" Make sure a hard tab is used, required for most make programs +setlocal noexpandtab softtabstop=0 + +" Set 'formatoptions' to break comment lines but not other lines, +" and insert the comment leader when hitting or using "o". +setlocal fo-=t fo+=croql + +" Set 'comments' to format dashed lists in comments +setlocal com=sO:#\ -,mO:#\ \ ,b:# + +" Set 'commentstring' to put the marker after a #. +setlocal commentstring=#\ %s + +" Including files. +let &l:include = '^\s*include' + +" For matchit.vim, suggested by Albert Netymk and Ken Takata. +if exists("loaded_matchit") + let b:match_words = '^ *ifn\=\(eq\|def\)\>:^ *else\(\s\+ifn\=\(eq\|def\)\)\=\>:^ *endif\>,\:\,^!\s*if\(n\=def\)\=\>:^!\s*else\(if\(n\=def\)\=\)\=\>:^!\s*endif\>' +endif + +endif diff --git a/ftplugin/sbt.vim b/ftplugin/sbt.vim new file mode 100644 index 00000000..13601c87 --- /dev/null +++ b/ftplugin/sbt.vim @@ -0,0 +1,19 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1 + +" Vim filetype plugin file +" Language: sbt +" Maintainer: Steven Dobay +" License: Same as Vim +" Last Change: 2017.04.30 +" ---------------------------------------------------------------------------- + +if exists('b:did_ftplugin') || &cp + finish +endif + +let b:did_ftplugin = 1 + +runtime! ftplugin/scala.vim + + +endif diff --git a/ftplugin/xf86conf.vim b/ftplugin/xf86conf.vim new file mode 100644 index 00000000..c298379b --- /dev/null +++ b/ftplugin/xf86conf.vim @@ -0,0 +1,23 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'xf86conf') == -1 + +" Vim filetype plugin file +" Language: XFree86 Configuration File +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2008-07-09 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let b:undo_ftplugin = "setl com< cms< fo<" + +setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql + +let &cpo = s:cpo_save +unlet s:cpo_save + +endif -- cgit v1.2.3