Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion runtime/syntax/dockerfile.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <https://honza.ca>
" Last Change: 2024 Dec 20
" 2026 Mar 26 by Vim Project: dockerfileShell comments (#19829)
" License: BSD

" https://docs.docker.com/engine/reference/builder/
Expand Down Expand Up @@ -31,7 +32,7 @@ syntax match dockerfileInstruction contained /\v<(SHELL|VOLUME)>/

syntax region dockerfileString contained start=/\v"/ skip=/\v\\./ end=/\v"/
syntax region dockerfileJSON contained keepend start=/\v\[/ skip=/\v\\\_./ end=/\v$/ contains=@JSON
syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=@Shell
syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_.|^\s*#.*/ end=/\v$/ contains=@Shell
syntax region dockerfileValue contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=dockerfileString

syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/ contains=@Spell
Expand Down
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/dockerfile_00.dump

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions runtime/syntax/testdir/input/dockerfile.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Issue #8364 (Docker syntax highlighting - Comments break up RUN highlighting
# in multi-line mode)

FROM debian:10.3

RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y curl grep sed unzip git sudo jq gettext \
# Azure CLI
&& cd /tmp \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
# Clean-up Apt Caches
&& apt-get clean \
&& rm -rf /var/lib/apt/lists
Loading