Ultraedit docker 语法高亮文件

Ultraedit docker syntax hightlighting file

http://www.ultraedit.com/downloads/extras/wordfiles.html 我没有找到 Docker.

的 wordfile

http://www.ultraedit.com/support/tutorials_power_tips/ultraedit_linux/add_a_wordfile.html 解释您如何扮演自己的角色。

灵感来自 https://github.com/docker/docker/blob/master/contrib/syntax/vim/syntax/dockerfile.vim 我试过了:

/L20"Docker" Line Comment = #  Escape Char = \ String Chars = "' File Extensions = 
/Delimiters = ~!@$%^*()+=/\[]{}:;"<>'�` ,   .?
/Indent Strings = "{("
/Unindent Strings = "})"
/Function String = "%[a-zA-Z_]*("
/C1
ADD
CMD
ENTRYPOINT
ENV
EXPOSE
FROM
MAINTAINER
RUN
USER
LABEL
VOLUME
WORKDIR
COPY
STOPSIGNAL
/C2
/C3
]
[
/C4

开始。

需要做哪些更改才能使其成为 docker 的正确语法高亮文件?

在我的 Mac 我把上面的代码放到 /Library/Application Support/UltraEdit/wordfiles/docker.uew

然后重新启动 Ultraedit 并主动从视图菜单中选择 Docker 的语法高亮。

该教程提到:

Any files opened after saving the modified wordfile, which have an extension matching those defined in the wordfile, will be highlighted accordingly.

但是默认情况下,Dockerfile 没有扩展名。

从 UltraEdit v19.00 开始,一些 shebang 支持自动检测和突出显示不带扩展名的文件类型。
但这对这里没有帮助。

用户可以随时通过单击 View - View as (Highlighting File Type) 中的相应菜单项来切换语法突出显示。

但是this thread also mentions:

The conditions for automatic syntax highlighting selection by UltraEdit on opening a file or saving a file with changed file name are:

  1. Does name of file match case-insensitive a file name specified for a syntax highlighting language with File Names =?

因此,将 File Extensions = 替换为 File Names = Dockerfile(等号前后的 space 很重要)指令,看看是否可行。

Mofi mentions in an edit:

File Extensions and File Names cannot be specified both in a wordfile.

您现在可以从

下载以下 docker 的 UltraEdit Word 文件

https://github.com/BITPlan/docker-Whosebuganswers/tree/master/33205986

/L20"Docker" Line Comment = #  Escape Char = \ String Chars = "' File Names = Dockerfile
/Delimiters = ~!@$%^*()+=/\[]{}:;"<>'�` ,   .?
/Indent Strings = "{("
/Unindent Strings = "})"
/Function String = "%[a-zA-Z_]*("
/C1
ADD
CMD
ENTRYPOINT
ENV
EXPOSE
FROM
MAINTAINER
RUN
USER
LABEL
VOLUME
WORKDIR
COPY
STOPSIGNAL
/C2
/C3
]
[
/C4