diff options
| author | Anton Bobov <anton@bobov.name> | 2023-08-05 23:33:24 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2023-08-05 23:33:24 +0500 |
| commit | 5e90863365043bad15617abbd9a39bdd3d020eb5 (patch) | |
| tree | 6cfe2b6a13d913126b929b9b37d43d5081f70362 /files/.vim | |
| parent | 3f532c7393edea16117b14b20c63cd128480d4bf (diff) | |
[vim] Add http syntax and updated Dockerfile template
Diffstat (limited to 'files/.vim')
| -rw-r--r-- | files/.vim/syntax/http.vim | 32 | ||||
| -rw-r--r-- | files/.vim/templates/=template=Dockerfile | 6 |
2 files changed, 36 insertions, 2 deletions
diff --git a/files/.vim/syntax/http.vim b/files/.vim/syntax/http.vim new file mode 100644 index 0000000..bdec9cc --- /dev/null +++ b/files/.vim/syntax/http.vim @@ -0,0 +1,32 @@ +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn keyword httpMethod OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT PATCH contained + +syn match httpProto 'HTTP/[0-9.]\+' contained +syn match httpStatusCode '[0-9]\{3\}' contained +syn match httpStatus '[0-9]\{3\} .*$' contained contains=httpStatusCode +syn match httpHeaderKey '^[A-Z][A-Za-z0-9\-]*:' contained +syn match httpURILine '^\(OPTIONS\|GET\|HEAD\|POST\|PUT\|DELETE\|TRACE\|CONNECT\|PATCH\)\( .*\)\?\(HTTP/[0-9.]\+\)\?$' contains=httpMethod,httpProto contained +syn match httpResponseLine '^HTTP/[0-9.]\+ [0-9]\{3\}.*$' contains=httpProto,httpStatus contained +syn match httpHeaderLine '^[A-Z][A-Za-z0-9\-]*: .*$' contains=httpHeaderKey contained + +syn region httpHeader start='^\(OPTIONS\|GET\|HEAD\|POST\|PUT\|DELETE\|TRACE\|CONNECT\|PATCH\)\( .*\)\?\(HTTP/[0-9.]\+\)\?$' end='\n\s*\n' contains=httpURILine,httpHeaderLine +syn region httpHeader start='^HTTP/[0-9.]\+ [0-9]\{3\}.*$' end='\n\s*\n' contains=httpResponseLine,httpHeaderLine + +hi link httpMethod Type +hi link httpProto Statement +hi link httpHeaderKey Identifier +hi link httpStatus String +hi link httpStatusCode Number + +let b:current_syntax = 'http' + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/files/.vim/templates/=template=Dockerfile b/files/.vim/templates/=template=Dockerfile index 73bebac..f4e563c 100644 --- a/files/.vim/templates/=template=Dockerfile +++ b/files/.vim/templates/=template=Dockerfile @@ -1,5 +1,7 @@ FROM abobov/debian:testing -MAINTAINER Anton Bobov <abobov@gmail.com> +LABEL maintainer="Anton Bobov <abobov@gmail.com>" -RUN apt-get update && apt-get install -y %HERE% +RUN apt-get update && apt-get install --no-install-recommends -y %HERE% \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* |
