diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2013-09-26 12:48:01 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2013-09-26 12:48:01 +0200 |
commit | 2b1938816662934441e86b8891db8368f1bdf37d (patch) | |
tree | 01e952339c5aab7e03fcd374112f846aa04150c5 | |
parent | a531f6b1045971aee4cffb9a7178c17f9349f439 (diff) | |
download | vim-polyglot-2b1938816662934441e86b8891db8368f1bdf37d.tar.gz vim-polyglot-2b1938816662934441e86b8891db8368f1bdf37d.zip |
Add dockerfile syntax support
Diffstat (limited to '')
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | build | 1 | ||||
-rw-r--r-- | ftdetect/polyglot.vim | 1 | ||||
-rw-r--r-- | syntax/dockerfile.vim | 22 |
4 files changed, 25 insertions, 0 deletions
@@ -33,6 +33,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo - [css-color](https://github.com/ap/vim-css-color) (syntax) - [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect) +- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect) - [erlang](https://github.com/oscarh/vimerl) (syntax, indent, compiler, autoload, ftplugin) - [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect) @@ -73,6 +73,7 @@ PACKS=" css-color:ap/vim-css-color csv:chrisbra/csv.vim cucumber:tpope/vim-cucumber + dockerfile:honza/dockerfile.vim elixir:elixir-lang/vim-elixir erlang:oscarh/vimerl git:tpope/vim-git diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 3c2604c0..dc3b2e8f 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -12,6 +12,7 @@ endfunction autocmd BufNewFile,BufRead * call s:DetectCoffee() au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber +au BufNewFile,BufRead Dockerfile set filetype=dockerfile au BufRead,BufNewFile *.ex,*.exs set filetype=elixir au FileType elixir setl sw=2 sts=2 et iskeyword+=!,? autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,MERGE_}MSG set ft=gitcommit diff --git a/syntax/dockerfile.vim b/syntax/dockerfile.vim new file mode 100644 index 00000000..90e0651b --- /dev/null +++ b/syntax/dockerfile.vim @@ -0,0 +1,22 @@ +" dockerfile.vim - Syntax highlighting for Dockerfiles +" Maintainer: Honza Pokorny <http://honza.ca> +" Version: 0.5 + + +if exists("b:current_syntax") + finish +endif + +let b:current_syntax = "dockerfile" + +syntax case ignore + +syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/ +syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR)\s/ +highlight link dockerfileKeyword Keyword + +syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ +highlight link dockerfileString String + +syntax match dockerfileComment "\v^\s*#.*$" +highlight link dockerfileComment Comment |