1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-20 10:01:57 +03:00
kakoune/rc/extra/dockerfile.kak

43 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-07-18 23:58:24 +03:00
# http://docker.com
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# See https://docs.docker.com/reference/builder
# Detection
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate .*Dockerfile %{
set buffer filetype dockerfile
}
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
2017-01-04 03:07:45 +03:00
add-highlighter -group / regions dockerfile \
2015-07-18 23:58:24 +03:00
instruction '^(?i)(ONBUILD\h+)?(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR)' '$' '' \
comment '#' '$' ''
2017-01-04 03:07:45 +03:00
add-highlighter -group /dockerfile/instruction regex '^(?i)(ONBUILD\h+)?(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR)' 0:keyword
2015-07-18 23:58:24 +03:00
2017-01-04 03:07:45 +03:00
add-highlighter -group /dockerfile/instruction regions regions \
2015-07-18 23:58:24 +03:00
plain '^(?i)(ONBUILD\h+)?(LABEL|ENV)' '$' '' \
json '^(?i)(ONBUILD\h+)?(RUN|CMD|ADD|COPY|ENTRYPOINT|VOLUME)\h+\[' \] \[ \
sh '^(?i)(ONBUILD\h+)?(RUN|CMD|ENTRYPOINT)\h+([A-Z/a-z])+' '$' ''
2017-01-04 03:07:45 +03:00
add-highlighter -group /dockerfile/instruction/regions/plain regions regions \
2015-07-18 23:58:24 +03:00
string '"' '(?<!\\)(\\\\)*"' '' \
string "'" "'" ''
2017-01-04 03:07:45 +03:00
add-highlighter -group /dockerfile/instruction/regions/plain/regions/string fill string
2015-07-18 23:58:24 +03:00
2017-01-04 03:07:45 +03:00
add-highlighter -group /dockerfile/instruction/regions/json ref json
add-highlighter -group /dockerfile/instruction/regions/sh ref sh
2015-07-18 23:58:24 +03:00
2017-01-04 03:07:45 +03:00
add-highlighter -group /dockerfile/comment fill comment
2015-07-18 23:58:24 +03:00
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
2017-01-04 03:07:45 +03:00
hook -group dockerfile-highlight global WinSetOption filetype=dockerfile %{ add-highlighter ref dockerfile }
hook -group dockerfile-highlight global WinSetOption filetype=(?!dockerfile).* %{ remove-highlighter dockerfile }