Update Dockerfile provider to offical, closes #191

This commit is contained in:
Adam Stankiewicz 2017-03-23 11:30:58 +01:00
parent 0801eac01a
commit ba75890936
No known key found for this signature in database
GPG Key ID: A62480DCEAC884DF
4 changed files with 15 additions and 15 deletions

View File

@ -51,7 +51,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [css](https://github.com/JulesWang/css.vim) (syntax) - [css](https://github.com/JulesWang/css.vim) (syntax)
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect) - [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect)
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [dockerfile](https://github.com/docker/docker) (syntax, ftdetect)
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect) - [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect) - [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect)

2
build
View File

@ -117,7 +117,7 @@ PACKS="
css:JulesWang/css.vim css:JulesWang/css.vim
cucumber:tpope/vim-cucumber cucumber:tpope/vim-cucumber
dart:dart-lang/dart-vim-plugin dart:dart-lang/dart-vim-plugin
dockerfile:honza/dockerfile.vim dockerfile:docker/docker::/contrib/syntax/vim/
elixir:elixir-lang/vim-elixir elixir:elixir-lang/vim-elixir
elm:lambdatoast/elm.vim elm:lambdatoast/elm.vim
emberscript:yalesov/vim-ember-script emberscript:yalesov/vim-ember-script

View File

@ -137,7 +137,7 @@ endif
" ftdetect/dockerfile.vim " ftdetect/dockerfile.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
au BufNewFile,BufRead Dockerfile set filetype=dockerfile au BufNewFile,BufRead [Dd]ockerfile,Dockerfile.* set filetype=dockerfile
endif endif

View File

@ -1,7 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
" dockerfile.vim - Syntax highlighting for Dockerfiles " dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <http://honza.ca> " Maintainer: Honza Pokorny <https://honza.ca>
" Version: 0.5 " Version: 0.5
@ -9,10 +9,11 @@ if exists("b:current_syntax")
finish finish
endif endif
let b:current_syntax = "dockerfile"
syntax case ignore syntax case ignore
syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/ syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s/
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR|COPY)\s/
highlight link dockerfileKeyword Keyword highlight link dockerfileKeyword Keyword
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
@ -21,15 +22,14 @@ highlight link dockerfileString String
syntax match dockerfileComment "\v^\s*#.*$" syntax match dockerfileComment "\v^\s*#.*$"
highlight link dockerfileComment Comment highlight link dockerfileComment Comment
syntax include @DockerSh syntax/sh.vim set commentstring=#\ %s
try
syntax include @DockerSh after/syntax/sh.vim
catch
endtry
syntax region dockerShSnip matchgroup=DockerShGroup start="^\s*\%(RUN\|CMD\)\s\+" end="$" contains=@DockerSh " match "RUN", "CMD", and "ENTRYPOINT" lines, and parse them as shell
highlight link DockerShGroup dockerfileKeyword let s:current_syntax = b:current_syntax
unlet b:current_syntax
let b:current_syntax = "dockerfile" syntax include @SH syntax/sh.vim
let b:current_syntax = s:current_syntax
syntax region shLine matchgroup=dockerfileKeyword start=/\v^\s*(RUN|CMD|ENTRYPOINT)\s/ end=/\v$/ contains=@SH
" since @SH will handle "\" as part of the same line automatically, this "just works" for line continuation too, but with the caveat that it will highlight "RUN echo '" followed by a newline as if it were a block because the "'" is shell line continuation... not sure how to fix that just yet (TODO)
endif endif