nginx.conf and dockerfile带颜色

Posted 追梦NAN的运维开发之路

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx.conf and dockerfile带颜色相关的知识,希望对你有一定的参考价值。

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

以上是关于nginx.conf and dockerfile带颜色的主要内容,如果未能解决你的问题,请参考以下文章

nginx 配置nginx.conf

Nginx配置文件 nginx.conf 和default.conf 讲解

nginx:如何划分 /etc/nginx/conf.d/default.conf ?

nginx-(/usr/local/nginx/conf/nginx.conf)更改配置文件

5,nginx 多域名,配置多个conf 文件

Nginx------nginx.conf 配置文件