wget http://www.vim.org/scripts/download_script.php?src_id=14376 -O nginx.vim
mv nginx.vim /usr/share/vim/vim74/syntax
echo "au BufRead,BufNewFile /application/nginx/* if &ft == '' | setfiletype nginx | endif" >> /usr/share/vim/vim74/filetype.vim #注意路径
docker
/usr/share/vim/vimfiles/doc/dockerfile.txt
*dockerfile.txt* Syntax highlighting for Dockerfiles
Author: Honza Pokorny <https://honza.ca>
License: BSD
INSTALLATION *installation*
Drop it on your Pathogen path and you're all set.
FEATURES *features*
The syntax highlighting includes:
* The directives (e.g. FROM)
* Strings
* Comments
vim:tw=78:et:ft=help:norl:
/usr/share/vim/vimfiles/ftdetect/dockerfile.vim
au BufNewFile,BufRead [Dd]ockerfile,Dockerfile.*,*.Dockerfile set filetype=dockerfile
/usr/share/vim/vimfiles/syntax/dockerfile.vim
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "dockerfile"
syntax case ignore
syntax match dockerfileKeyword /v^s*(ONBUILDs+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLU
ME|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
set commentstring=# %s
" match "RUN", "CMD", and "ENTRYPOINT" lines, and parse them as shell
let s:current_syntax = b:current_syntax
unlet b:current_syntax
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