Commit: patch 9.2.1002: filetype: bazelrc files are not recognized

2 views
Skip to first unread message

Christian Brabandt

unread,
Aug 25, 2026, 3:30:19 PM (2 days ago) Aug 25
to vim...@googlegroups.com
patch 9.2.1002: filetype: bazelrc files are not recognized

Commit: https://github.com/vim/vim/commit/1afe7ad1bb72f36a80f8e625b91d0e7506ce8985
Author: Barrett Ruth <b...@barrettruth.com>
Date: Tue Aug 25 19:17:25 2026 +0000

patch 9.2.1002: filetype: bazelrc files are not recognized

Problem: filetype: bazelrc files are not recognized
Solution: Detect *.bazelrc and tools/bazel.rc files as bazelrc filetype,
include syntax und filetype plugins, update the menus
(Barrett Ruth).

closes: #21146

Signed-off-by: Barrett Ruth <b...@barrettruth.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS
index 93646aba4..26d79fc06 100644
--- a/.github/MAINTAINERS
+++ b/.github/MAINTAINERS
@@ -150,6 +150,7 @@ runtime/ftplugin/asy.vim @avidseeker
runtime/ftplugin/autohotkey.vim @telemachus
runtime/ftplugin/awk.vim @dkearns
runtime/ftplugin/basic.vim @dkearns
+runtime/ftplugin/bazelrc.vim @barrettruth
runtime/ftplugin/beancount.vim @nathangrigg
runtime/ftplugin/bicep.vim @scottmckendry
runtime/ftplugin/bicep-params.vim @scottmckendry
@@ -508,6 +509,7 @@ runtime/syntax/asy.vim @avidseeker
runtime/syntax/autohotkey.vim @mmikeww
runtime/syntax/awk.vim @dkearns
runtime/syntax/basic.vim @dkearns
+runtime/syntax/bazelrc.vim @barrettruth
runtime/syntax/beancount.vim @nathangrigg
runtime/syntax/bpftrace.vim @sgruszka
runtime/syntax/bst.vim @tpope
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index c346bd139..f28a89fc0 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -3,7 +3,7 @@ vim9script
# Vim functions for file type detection
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
-# Last Change: 2026 Aug 10
+# Last Change: 2026 Aug 25
# Former Maintainer: Bram Moolenaar <Br...@vim.org>

# These functions are moved here from runtime/filetype.vim to make startup
@@ -1851,6 +1851,8 @@ const ft_from_ext = {
"ibi": "ibasic",
# FreeBasic file (similar to QBasic)
"fb": "freebasic",
+ # Bazel rc file
+ "bazelrc": "bazelrc",
# Batch file for MSDOS. See dist#ft#FTsys for *.sys
"bat": "dosbatch",
# BC calculator
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 7241efb45..46fca304c 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2026 Aug 13
+" Last Change: 2026 Aug 25
" Former Maintainer: Bram Moolenaar <Br...@vim.org>

" If the filetype can be detected from extension or file name(the final path component),
@@ -185,6 +185,9 @@ if has("fname_case")
au BufNewFile,BufRead *.BUILD,BUILD,BUCK setf bzl
endif

+" Bazel rc file, the workspace location used before Bazel 0.17
+au BufNewFile,BufRead */tools/bazel.rc setf bazelrc
+
" Bundle config
au BufNewFile,BufRead */.bundle/config setf yaml

diff --git a/runtime/ftplugin/bazelrc.vim b/runtime/ftplugin/bazelrc.vim
new file mode 100644
index 000000000..7f763f712
--- /dev/null
+++ b/runtime/ftplugin/bazelrc.vim
@@ -0,0 +1,17 @@
+" Vim filetype plugin file
+" Language: Bazel rc file
+" Maintainer: Barrett Ruth <b...@barrettruth.com>
+" Last Change: 2026 Aug 25
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal comments=:#
+setlocal commentstring=#\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
+let b:undo_ftplugin = "setlocal com< cms< fo<"
+
+" vim: ts=8
diff --git a/runtime/makemenu.vim b/runtime/makemenu.vim
index 3497a773f..1ac2a27ac 100644
--- a/runtime/makemenu.vim
+++ b/runtime/makemenu.vim
@@ -2,7 +2,7 @@ vim9script

# Script to define the syntax menu in synmenu.vim
# Maintainer: The Vim Project <https://github.com/vim/vim>
-# Last Change: 2026 Aug 06
+# Last Change: 2026 Aug 25
# Former Maintainer: Bram Moolenaar <Br...@vim.org>

# This is used by "make menu" in the src directory.
@@ -119,6 +119,7 @@ SynMenu AB.Basic.QBasic:basic
SynMenu AB.Basic.Visual\ Basic:vb
SynMenu AB.Bazaar\ commit\ file:bzr
SynMenu AB.Bazel:bzl
+SynMenu AB.Bazel\ rc\ file:bazelrc
SynMenu AB.BC\ calculator:bc
SynMenu AB.BDF\ font:bdf
SynMenu AB.Beancount:beancount
diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim
index 93bd5731c..53d56772e 100644
--- a/runtime/synmenu.vim
+++ b/runtime/synmenu.vim
@@ -106,17 +106,18 @@ an 50.10.740 &Syntax.AB.Basic.QBasic :cal SetSyn("basic")<CR>
an 50.10.750 &Syntax.AB.Basic.Visual\ Basic :cal SetSyn("vb")<CR>
an 50.10.760 &Syntax.AB.Bazaar\ commit\ file :cal SetSyn("bzr")<CR>
an 50.10.770 &Syntax.AB.Bazel :cal SetSyn("bzl")<CR>
-an 50.10.780 &Syntax.AB.BC\ calculator :cal SetSyn("bc")<CR>
-an 50.10.790 &Syntax.AB.BDF\ font :cal SetSyn("bdf")<CR>
-an 50.10.800 &Syntax.AB.Beancount :cal SetSyn("beancount")<CR>
-an 50.10.810 &Syntax.AB.BibTeX.Bibliography\ database :cal SetSyn("bib")<CR>
-an 50.10.820 &Syntax.AB.BibTeX.Bibliography\ Style :cal SetSyn("bst")<CR>
-an 50.10.830 &Syntax.AB.BIND.BIND\ config :cal SetSyn("named")<CR>
-an 50.10.840 &Syntax.AB.BIND.BIND\ zone :cal SetSyn("bindzone")<CR>
-an 50.10.850 &Syntax.AB.Bitbake :cal SetSyn("bitbake")<CR>
-an 50.10.860 &Syntax.AB.Blank :cal SetSyn("blank")<CR>
-an 50.10.870 &Syntax.AB.Bpftrace :cal SetSyn("bpftrace")<CR>
-an 50.10.880 &Syntax.AB.Bsdl :cal SetSyn("bsdl")<CR>
+an 50.10.780 &Syntax.AB.Bazel\ rc\ file :cal SetSyn("bazelrc")<CR>
+an 50.10.790 &Syntax.AB.BC\ calculator :cal SetSyn("bc")<CR>
+an 50.10.800 &Syntax.AB.BDF\ font :cal SetSyn("bdf")<CR>
+an 50.10.810 &Syntax.AB.Beancount :cal SetSyn("beancount")<CR>
+an 50.10.820 &Syntax.AB.BibTeX.Bibliography\ database :cal SetSyn("bib")<CR>
+an 50.10.830 &Syntax.AB.BibTeX.Bibliography\ Style :cal SetSyn("bst")<CR>
+an 50.10.840 &Syntax.AB.BIND.BIND\ config :cal SetSyn("named")<CR>
+an 50.10.850 &Syntax.AB.BIND.BIND\ zone :cal SetSyn("bindzone")<CR>
+an 50.10.860 &Syntax.AB.Bitbake :cal SetSyn("bitbake")<CR>
+an 50.10.870 &Syntax.AB.Blank :cal SetSyn("blank")<CR>
+an 50.10.880 &Syntax.AB.Bpftrace :cal SetSyn("bpftrace")<CR>
+an 50.10.890 &Syntax.AB.Bsdl :cal SetSyn("bsdl")<CR>
an 50.20.100 &Syntax.C.C :cal SetSyn("c")<CR>
an 50.20.110 &Syntax.C.C++ :cal SetSyn("cpp")<CR>
an 50.20.120 &Syntax.C.C# :cal SetSyn("cs")<CR>
diff --git a/runtime/syntax/bazelrc.vim b/runtime/syntax/bazelrc.vim
new file mode 100644
index 000000000..e7589eea8
--- /dev/null
+++ b/runtime/syntax/bazelrc.vim
@@ -0,0 +1,123 @@
+" Vim syntax file
+" Language: Bazel rc file
+" Maintainer: Barrett Ruth <b...@barrettruth.com>
+" Last Change: 2026 Aug 25
+" Reference: https://bazel.build/run/bazelrc
+
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+let s:cpo_save = &cpo
+set cpo&vim
+
+syn case match
+syn iskeyword @,48-57,_,-
+
+" Comments {{{1
+
+" Backslash-newline is removed from the whole file before it is split into
+" lines, so a comment ending in one continues into the line below it.
+syn region bazelrcComment
+ \ start=/#/
+ \ skip=/\$/
+ \ end=/$/
+ \ contains=bazelrcTodo,@Spell
+syn keyword bazelrcTodo contained TODO FIXME XXX NOTE
+
+" Words {{{1
+
+" Bazel joins a continued line onto the one above before splitting the file
+" into lines, so what follows is a further option rather than a new command.
+syn match bazelrcContinuation /\$/
+ \ skipnl
+ \ nextgroup=bazelrcContinued
+syn match bazelrcContinued contained transparent /.*/
+ \ contains=bazelrcComment,bazelrcContinuation,bazelrcEscape,
+ \ bazelrcFlag,bazelrcString
+
+" A backslash escape is absorbed before quoting is considered, so it applies
+" inside single quotes too, and '\#' is a literal '#' rather than a comment.
+syn match bazelrcEscape /\./
+" A quote may open part-way through a word. An unterminated one is ignored
+" rather than continued onto the line below.
+syn region bazelrcString oneline
+ \ start=/'/
+ \ skip=/\./
+ \ end=/'/
+ \ contains=bazelrcEscape
+syn region bazelrcString oneline
+ \ start=/"/
+ \ skip=/\./
+ \ end=/"/
+ \ contains=bazelrcEscape
+
+" Imports {{{1
+
+syn match bazelrcImport /^\s*try-import-if-bazel-version\>/
+ \ skipwhite
+ \ nextgroup=bazelrcVersion
+syn match bazelrcImport /^\s*\%(try-\)\=import\>/
+ \ skipwhite
+ \ nextgroup=bazelrcPath
+" The comparison and the version it applies to are a single word.
+syn match bazelrcVersion contained
+ \ /\%(<=\|>=\|==\|!=\|[<>~]\)[^ #]\+/
+ \ skipwhite
+ \ nextgroup=bazelrcPath
+syn match bazelrcPath contained
+ \ /\%(\.\|[^ #]\)\+/
+ \ contains=bazelrcEscape,bazelrcString,bazelrcWorkspace
+" Substituted only as a prefix, and the trailing slash belongs to it.
+syn match bazelrcWorkspace contained /\%(^\|\s\)\@1<=%workspace%\//
+
+" Commands and options {{{1
+
+syn match bazelrcCommand
+ \ /^\s*\<\%(always\|aquery\|build\|canonicalize-flags\|clean\|common
+ \|config\|coverage\|cquery\|dump\|fetch\|help\|info\|license
+ \|mobile-install\|mod\|print_action\|query\|run\|shutdown\|startup
+ \|test\|vendor\|version\)\>/
+ \ nextgroup=bazelrcConfig
+" A command is split on its first colon, so a config name may contain colons.
+syn match bazelrcConfig contained /:[^ #]\+/
+
+syn match bazelrcFlag /--[^ #=]*/ nextgroup=bazelrcValue
+syn match bazelrcFlag /\%(^\|\s\)\@1<=-[a-zA-Z]\>/
+ \ nextgroup=bazelrcValue
+syn region bazelrcValue contained oneline
+ \ matchgroup=bazelrcOperator
+ \ start=/=/
+ \ end=/\ze[ #]/
+ \ end=/$/
+ \ contains=bazelrcString,bazelrcEscape
+
+" Syncing {{{1
+
+" A comment may continue onto the following line.
+syn sync linebreaks=1
+
+" Default Highlighting {{{1
+
+hi def link bazelrcComment Comment
+hi def link bazelrcTodo Todo
+hi def link bazelrcContinuation Special
+hi def link bazelrcEscape SpecialChar
+hi def link bazelrcString String
+hi def link bazelrcImport Include
+hi def link bazelrcVersion Constant
+hi def link bazelrcPath String
+hi def link bazelrcWorkspace PreProc
+hi def link bazelrcCommand Statement
+hi def link bazelrcConfig Type
+hi def link bazelrcFlag Identifier
+hi def link bazelrcOperator Operator
+
+" }}}
+
+let b:current_syntax = "bazelrc"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ts=8 fdm=marker:
diff --git a/runtime/syntax/testdir/dumps/bazelrc_00.dump b/runtime/syntax/testdir/dumps/bazelrc_00.dump
new file mode 100644
index 000000000..e9732117b
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/bazelrc_00.dump
@@ -0,0 +1,20 @@
+>#+0#0000e05#ffffff0| |B|a|z|e|l| |r|c| |f|i|l|e| +0#0000000&@59
+|#+0#0000e05&| |T+0#0000001#ffff4012|O|D|O| +0#0000e05#ffffff0|c|o|m@1|e|n|t|s| |a|r|e| |h|i|g|h|l|i|g|h|t|e|d| +0#0000000&@43
+@75
+|s+0#af5f00255&|t|a|r|t|u|p| +0#0000000&|-+0#00e0e07&@1|o|u|t|p|u|t|_|b|a|s|e|=+0#af5f00255&|/+0#0000000&|t|m|p|/|b|a|z|e|l| @42
+|c+0#af5f00255&|o|m@1|o|n| +0#0000000&|-+0#00e0e07&@1|e|n|a|b|l|e|_|p|l|a|t|f|o|r|m|_|s|p|e|c|i|f|i|c|_|c|o|n|f|i|g| +0#0000000&@34
+|a+0#af5f00255&|l|w|a|y|s| +0#0000000&|-+0#00e0e07&@1|a|n@1|o|u|n|c|e|_|r|c| +0#0000000&@54
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|j|o|b|s|=+0#af5f00255&|8+0#0000000&| |-+0#00e0e07&@1|v|e|r|b|o|s|e|_|f|a|i|l|u|r|e|s| +0#0000000&@41
+|t+0#af5f00255&|e|s|t| +0#0000000&|-+0#00e0e07&|c| +0#0000000&|d|b|g| |-+0#00e0e07&@1|t|e|s|t|_|e|n|v|=+0#af5f00255&|P+0#0000000&|A|T|H| @47
+|q+0#af5f00255&|u|e|r|y| +0#0000000&|-+0#00e0e07&@1|k|e@1|p|_|g|o|i|n|g| +0#0000000&@56
+@75
+|#+0#0000e05&| |A| |c|o|n|f|i|g| |n|a|m|e| |i|s| |e|v|e|r|y|t|h|i|n|g| |a|f|t|e|r| |t|h|e| |f|i|r|s|t| |c|o|l|o|n| +0#0000000&@23
+|b+0#af5f00255&|u|i|l|d|:+0#00e0003&|c|i| +0#0000000&|-+0#00e0e07&@1|r|e|m|o|t|e|_|c|a|c|h|e|=+0#af5f00255&|g+0#0000000&|r|p|c|s|:|/@1|c|a|c|h|e|.|e|x|a|m|p|l|e|.|c|o|m| |-+0#00e0e07&@1|c|o|n|f|i|g|=+0#af5f00255&|s+0#0000000&|t|r|i|c|t| @9
+|b+0#af5f00255&|u|i|l|d|:+0#00e0003&|s|t|r|i|c|t| +0#0000000&|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|W|a|l@1| |-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|W|e|r@1|o|r| @34
+|b+0#af5f00255&|u|i|l|d|:+0#00e0003&|f|o@1|:|b|a|r| +0#0000000&|-+0#00e0e07&@1|/@1|m|y|/|p|k|g|:|s|e|t@1|i|n|g|=+0#af5f00255&|1+0#0000000&| |-+0#00e0e07&@1|n|o|/@1|m|y|/|p|k|g|:|o|t|h|e|r| +0#0000000&@21
+|s+0#af5f00255&|t|a|r|t|u|p|:+0#00e0003&|l|i|n|u|x| +0#0000000&|-+0#00e0e07&@1|h|o|s|t|_|j|v|m|_|a|r|g|s|=+0#af5f00255&|-+0#0000000&|X|m|x|4|g| @38
+|c+0#af5f00255&|o|m@1|o|n|:+0#00e0003&|e|m|p|t|y| +0#0000000&@62
+@75
+|#+0#0000e05&| |Q|u|o|t|e|s| |m|a|y| |o|p|e|n| |p|a|r|t|-|w|a|y| |t|h|r|o|u|g|h| |a| |w|o|r|d| |a|n|d| |n|e@1|d| |n|o|t| |b|e| |c|l|o|s|e|d| +0#0000000&@10
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|'+0#e000002&|a| |b|'| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|"+0#e000002&|a|#|b|"| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|a+0#0000000&|"+0#e000002&|b| |c|"|d+0#0000000&| @22
+@57|1|,|1| @10|T|o|p|
diff --git a/runtime/syntax/testdir/dumps/bazelrc_01.dump b/runtime/syntax/testdir/dumps/bazelrc_01.dump
new file mode 100644
index 000000000..d72e8ebf3
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/bazelrc_01.dump
@@ -0,0 +1,20 @@
+|b+0#af5f00255#ffffff0|u|i|l|d|:+0#00e0003&|f|o@1|:|b|a|r| +0#0000000&|-+0#00e0e07&@1|/@1|m|y|/|p|k|g|:|s|e|t@1|i|n|g|=+0#af5f00255&|1+0#0000000&| |-+0#00e0e07&@1|n|o|/@1|m|y|/|p|k|g|:|o|t|h|e|r| +0#0000000&@21
+|s+0#af5f00255&|t|a|r|t|u|p|:+0#00e0003&|l|i|n|u|x| +0#0000000&|-+0#00e0e07&@1|h|o|s|t|_|j|v|m|_|a|r|g|s|=+0#af5f00255&|-+0#0000000&|X|m|x|4|g| @38
+|c+0#af5f00255&|o|m@1|o|n|:+0#00e0003&|e|m|p|t|y| +0#0000000&@62
+@75
+|#+0#0000e05&| |Q|u|o|t|e|s| |m|a|y| |o|p|e|n| |p|a|r|t|-|w|a|y| |t|h|r|o|u|g|h| |a| |w|o|r|d| |a|n|d| |n|e@1|d| |n|o|t| |b|e| |c|l|o|s|e|d| +0#0000000&@10
+>b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|'+0#e000002&|a| |b|'| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|"+0#e000002&|a|#|b|"| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|a+0#0000000&|"+0#e000002&|b| |c|"|d+0#0000000&| @22
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|D|N|A|M|E|=|\+0#e000e06&|"|x+0#0000000&|\+0#e000e06&|"| +0#0000000&|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|D|S|P|A|C|E|=|a|\+0#e000e06&| |b+0#0000000&| @29
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|d|e|f|i|n|e|=+0#af5f00255&|"+0#0000000&|u|n|t|e|r|m|i|n|a|t|e|d| @46
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|j|o|b|s|=+0#af5f00255&|8+0#0000000&| @60
+@75
+|#+0#0000e05&| |A|n| |u|n|q|u|o|t|e|d| |#| |s|t|a|r|t|s| |a| |c|o|m@1|e|n|t|,| |w|i|t|h| |o|r| |w|i|t|h|o|u|t| |l|e|a|d|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@6
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|j|o|b|s|=+0#af5f00255&|4+0#0000000&| |#+0#0000e05&| |t|r|a|i|l|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@41
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|j|o|b|s|=+0#af5f00255&|2+0#0000000&|#+0#0000e05&| |n|o| |l|e|a|d|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@37
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|\+0#e000e06&|#|n+0#0000000&|o|t|a|c|o|m@1|e|n|t| @48
+@75
+|#+0#0000e05&| |A| |t|r|a|i|l|i|n|g| |b|a|c|k|s|l|a|s|h| |j|o|i|n|s| |t|h|e| |f|o|l@1|o|w|i|n|g| |l|i|n|e| +0#0000000&@27
+|b+0#af5f00255&|u|i|l|d| +0#0000000&|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|W|e|x|t|r|a| |\+0#e000e06&| +0#0000000&@52
+@6|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|W|p|e|d|a|n|t|i|c| |\+0#e000e06&| +0#0000000&@49
+@6|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|W|s|h|a|d|o|w| @53
+@57|1|9|,|1| @9|5|2|%|
diff --git a/runtime/syntax/testdir/dumps/bazelrc_02.dump b/runtime/syntax/testdir/dumps/bazelrc_02.dump
new file mode 100644
index 000000000..7bb4ba1db
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/bazelrc_02.dump
@@ -0,0 +1,20 @@
+| +0&#ffffff0@5|-+0#00e0e07&@1|c|o|p|t|=+0#af5f00255&|-+0#0000000&|W|s|h|a|d|o|w| @53
+@75
+|#+0#0000e05&| |.@2|i|n|c|l|u|d|i|n|g| |i|n|s|i|d|e| |a| |c|o|m@1|e|n|t|,| |s|o| |t|h|i|s| |l|i|n|e| |i|s| |c|o|m@1|e|n|t|e|d| |t|o@1| |\| +0#0000000&@10
+|b+0#0000e05&|u|i|l|d| |-@1|t|h|i|s|_|l|i|n|e|_|i|s|_|p|a|r|t|_|o|f|_|t|h|e|_|c|o|m@1|e|n|t| +0#0000000&@34
+@75
+>i+0#e000e06&|m|p|o|r|t| +0#0000000&|/+0#e000002&|e|t|c|/|b|a|z|e|l|/|s|i|t|e|.|b|a|z|e|l|r|c| +0#0000000&@44
+|i+0#e000e06&|m|p|o|r|t| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|t+0#e000002&|o@1|l|s|/|f|l|a|g|s|.|b|a|z|e|l|r|c| +0#0000000&@36
+|t+0#e000e06&|r|y|-|i|m|p|o|r|t| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|u+0#e000002&|s|e|r|.|b|a|z|e|l|r|c| +0#0000000&@39
+|t+0#e000e06&|r|y|-|i|m|p|o|r|t|-|i|f|-|b|a|z|e|l|-|v|e|r|s|i|o|n| +0#0000000&|>+0#e000002&|=|7|.|0|.|0| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|c+0#e000002&|o|n|f|i|g|s|/|v|7|.|r|c| +0#0000000&@13
+|t+0#e000e06&|r|y|-|i|m|p|o|r|t|-|i|f|-|b|a|z|e|l|-|v|e|r|s|i|o|n| +0#0000000&|<+0#e000002&|8| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|c+0#e000002&|o|n|f|i|g|s|/|p|r|e|_|v|8|.|r|c| +0#0000000&@14
+|t+0#e000e06&|r|y|-|i|m|p|o|r|t|-|i|f|-|b|a|z|e|l|-|v|e|r|s|i|o|n| +0#0000000&|=+0#e000002&@1|6|.|3|.|2| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|c+0#e000002&|o|n|f|i|g|s|/|h|o|t|f|i|x|.|r|c| +0#0000000&@9
+|t+0#e000e06&|r|y|-|i|m|p|o|r|t|-|i|f|-|b|a|z|e|l|-|v|e|r|s|i|o|n| +0#0000000&|!+0#e000002&|=|7|.|0|.|1| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|c+0#e000002&|o|n|f|i|g|s|/|s|t|a|n|d|a|r|d|.|r|c| +0#0000000&@7
+|t+0#e000e06&|r|y|-|i|m|p|o|r|t|-|i|f|-|b|a|z|e|l|-|v|e|r|s|i|o|n| +0#0000000&|~+0#e000002&|8|.|1| +0#0000000&|%+0#e000e06&|w|o|r|k|s|p|a|c|e|%|/|c+0#e000002&|o|n|f|i|g|s|/|v|8|_|1|.|r|c| +0#0000000&@14
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|3|7|,|1| @9|B|o|t|
diff --git a/runtime/syntax/testdir/input/bazelrc.bazelrc b/runtime/syntax/testdir/input/bazelrc.bazelrc
new file mode 100644
index 000000000..dd6d42d3f
--- /dev/null
+++ b/runtime/syntax/testdir/input/bazelrc.bazelrc
@@ -0,0 +1,44 @@
+# Bazel rc file
+# TODO comments are highlighted
+
+startup --output_base=/tmp/bazel
+common --enable_platform_specific_config
+always --announce_rc
+build --jobs=8 --verbose_failures
+test -c dbg --test_env=PATH
+query --keep_going
+
+# A config name is everything after the first colon
+build:ci --remote_cache=grpcs://cache.example.com --config=strict
+build:strict --copt=-Wall --copt=-Werror
+build:foo:bar --//my/pkg:setting=1 --no//my/pkg:other
+startup:linux --host_jvm_args=-Xmx4g
+common:empty
+
+# Quotes may open part-way through a word and need not be closed
+build --define='a b' --define="a#b" --define=a"b c"d
+build --copt=-DNAME=\"x\" --copt=-DSPACE=a\ b
+build --define="unterminated
+build --jobs=8
+
+# An unquoted # starts a comment, with or without leading whitespace
+build --jobs=4 # trailing comment
+build --jobs=2# no leading whitespace
+build --copt=\#notacomment
+
+# A trailing backslash joins the following line
+build --copt=-Wextra \
+ --copt=-Wpedantic \
+ --copt=-Wshadow
+
+# ...including inside a comment, so this line is commented too \
+build --this_line_is_part_of_the_comment
+
+import /etc/bazel/site.bazelrc
+import %workspace%/tools/flags.bazelrc
+try-import %workspace%/user.bazelrc
+try-import-if-bazel-version >=7.0.0 %workspace%/configs/v7.rc
+try-import-if-bazel-version <8 %workspace%/configs/pre_v8.rc
+try-import-if-bazel-version ==6.3.2 %workspace%/configs/hotfix.rc
+try-import-if-bazel-version !=7.0.1 %workspace%/configs/standard.rc
+try-import-if-bazel-version ~8.1 %workspace%/configs/v8_1.rc
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index eb13b52e2..8abaa6132 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -136,6 +136,7 @@ def s:GetFilenameChecks(): dict<list<string>>
b: ['file.mch', 'file.ref', 'file.imp'],
basic: ['file.bas', 'file.bi', 'file.bm'],
bass: ['file.bass'],
+ bazelrc: ['.bazelrc', 'user.bazelrc', 'file.bazelrc', '/tools/bazel.rc', 'any/tools/bazel.rc'],
bc: ['file.bc'],
bdf: ['file.bdf'],
beancount: ['file.beancount', 'file.bean'],
diff --git a/src/version.c b/src/version.c
index 586d940fd..4636427d3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -763,6 +763,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1002,
/**/
1001,
/**/
Reply all
Reply to author
Forward
0 new messages