From 58f9b8cd02ecb2a753d418627f57f917f5f748a9 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 4 Mar 2019 11:00:45 +0100 Subject: Proper casing for Dockerfile, fixes #361 --- syntax/Dockerfile.vim | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ syntax/dockerfile.vim | 68 --------------------------------------------------- 2 files changed, 68 insertions(+), 68 deletions(-) create mode 100644 syntax/Dockerfile.vim delete mode 100644 syntax/dockerfile.vim (limited to 'syntax') diff --git a/syntax/Dockerfile.vim b/syntax/Dockerfile.vim new file mode 100644 index 00000000..1670c8f7 --- /dev/null +++ b/syntax/Dockerfile.vim @@ -0,0 +1,68 @@ +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dockerfile') != -1 + finish +endif + +" Vim syntax file +" Language: Dockerfile +" Maintainer: Eugene Kalinin +" Latest Revision: 11 September 2013 +" Source: http://docs.docker.io/en/latest/use/builder/ + +if exists("b:current_syntax") + finish +endif + +" case sensitivity (fix #17) +" syn case ignore + +" Keywords +syn keyword dockerfileKeywords FROM AS MAINTAINER RUN CMD COPY +syn keyword dockerfileKeywords EXPOSE ADD ENTRYPOINT +syn keyword dockerfileKeywords VOLUME USER WORKDIR ONBUILD +syn keyword dockerfileKeywords LABEL ARG HEALTHCHECK SHELL + +" Bash statements +setlocal iskeyword+=- +syn keyword bashStatement add-apt-repository adduser apk apt-get aptitude apt-key autoconf bundle +syn keyword bashStatement cd chgrp chmod chown clear complete composer cp curl du echo egrep +syn keyword bashStatement expr fgrep find gem gnufind gnugrep gpg grep groupadd head less ln +syn keyword bashStatement ls make mkdir mv node npm pacman pip pip3 php python rails rm rmdir rpm ruby +syn keyword bashStatement sed sleep sort strip tar tail tailf touch useradd virtualenv yum +syn keyword bashStatement usermod bash cat a2ensite a2dissite a2enmod a2dismod apache2ctl +syn keyword bashStatement wget gzip + +" Strings +syn region dockerfileString start=/"/ skip=/\\"|\\\\/ end=/"/ +syn region dockerfileString1 start=/'/ skip=/\\'|\\\\/ end=/'/ + +" Emails +syn region dockerfileEmail start=// contains=@ oneline + +" Urls +syn match dockerfileUrl /\(http\|https\|ssh\|hg\|git\)\:\/\/[a-zA-Z0-9\/\-\.]\+/ + +" Task tags +syn keyword dockerfileTodo contained TODO FIXME XXX + +" Comments +syn region dockerfileComment start="#" end="\n" contains=dockerfileTodo +syn region dockerfileEnvWithComment start="^\s*ENV\>" end="\n" contains=dockerfileEnv +syn match dockerfileEnv contained /\/ + +" Highlighting +hi link dockerfileKeywords Keyword +hi link dockerfileEnv Keyword +hi link dockerfileString String +hi link dockerfileString1 String +hi link dockerfileComment Comment +hi link dockerfileEmail Identifier +hi link dockerfileUrl Identifier +hi link dockerfileTodo Todo +hi link bashStatement Function + +let b:current_syntax = "dockerfile" + +set commentstring=#\ %s + +" Enable automatic comment insertion +setlocal fo+=cro diff --git a/syntax/dockerfile.vim b/syntax/dockerfile.vim deleted file mode 100644 index 1670c8f7..00000000 --- a/syntax/dockerfile.vim +++ /dev/null @@ -1,68 +0,0 @@ -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dockerfile') != -1 - finish -endif - -" Vim syntax file -" Language: Dockerfile -" Maintainer: Eugene Kalinin -" Latest Revision: 11 September 2013 -" Source: http://docs.docker.io/en/latest/use/builder/ - -if exists("b:current_syntax") - finish -endif - -" case sensitivity (fix #17) -" syn case ignore - -" Keywords -syn keyword dockerfileKeywords FROM AS MAINTAINER RUN CMD COPY -syn keyword dockerfileKeywords EXPOSE ADD ENTRYPOINT -syn keyword dockerfileKeywords VOLUME USER WORKDIR ONBUILD -syn keyword dockerfileKeywords LABEL ARG HEALTHCHECK SHELL - -" Bash statements -setlocal iskeyword+=- -syn keyword bashStatement add-apt-repository adduser apk apt-get aptitude apt-key autoconf bundle -syn keyword bashStatement cd chgrp chmod chown clear complete composer cp curl du echo egrep -syn keyword bashStatement expr fgrep find gem gnufind gnugrep gpg grep groupadd head less ln -syn keyword bashStatement ls make mkdir mv node npm pacman pip pip3 php python rails rm rmdir rpm ruby -syn keyword bashStatement sed sleep sort strip tar tail tailf touch useradd virtualenv yum -syn keyword bashStatement usermod bash cat a2ensite a2dissite a2enmod a2dismod apache2ctl -syn keyword bashStatement wget gzip - -" Strings -syn region dockerfileString start=/"/ skip=/\\"|\\\\/ end=/"/ -syn region dockerfileString1 start=/'/ skip=/\\'|\\\\/ end=/'/ - -" Emails -syn region dockerfileEmail start=// contains=@ oneline - -" Urls -syn match dockerfileUrl /\(http\|https\|ssh\|hg\|git\)\:\/\/[a-zA-Z0-9\/\-\.]\+/ - -" Task tags -syn keyword dockerfileTodo contained TODO FIXME XXX - -" Comments -syn region dockerfileComment start="#" end="\n" contains=dockerfileTodo -syn region dockerfileEnvWithComment start="^\s*ENV\>" end="\n" contains=dockerfileEnv -syn match dockerfileEnv contained /\/ - -" Highlighting -hi link dockerfileKeywords Keyword -hi link dockerfileEnv Keyword -hi link dockerfileString String -hi link dockerfileString1 String -hi link dockerfileComment Comment -hi link dockerfileEmail Identifier -hi link dockerfileUrl Identifier -hi link dockerfileTodo Todo -hi link bashStatement Function - -let b:current_syntax = "dockerfile" - -set commentstring=#\ %s - -" Enable automatic comment insertion -setlocal fo+=cro -- cgit v1.2.3