diff --git a/runtime/ftplugin/bicep-params.vim b/runtime/ftplugin/bicep-params.vim new file mode 100644 index 0000000000..7cc2d85126 --- /dev/null +++ b/runtime/ftplugin/bicep-params.vim @@ -0,0 +1,3 @@ +" Placeholder for maximum compatibility. While bicepparam files are treated as distinct filetypes, +" they are should share the same ftplugin settings as bicep files. +runtime! ftplugin/bicep.vim diff --git a/runtime/ftplugin/bicep.vim b/runtime/ftplugin/bicep.vim new file mode 100644 index 0000000000..f142daf135 --- /dev/null +++ b/runtime/ftplugin/bicep.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: Bicep +" Maintainer: Scott McKendry +" Last Change: 2025 Dec 27 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 0e74321294..02c0a83bf9 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -260,7 +260,7 @@ local extension = { com = detect_seq(detect.bindzone, 'dcl'), db = detect.bindzone, bicep = 'bicep', - bicepparam = 'bicep', + bicepparam = 'bicep-params', zone = 'bindzone', bb = 'bitbake', bbappend = 'bitbake', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index ca35b287cc..5112089f73 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -141,7 +141,8 @@ func s:GetFilenameChecks() abort \ 'bdf': ['file.bdf'], \ 'beancount': ['file.beancount'], \ 'bib': ['file.bib'], - \ 'bicep': ['file.bicep', 'file.bicepparam'], + \ 'bicep': ['file.bicep'], + \ 'bicep-params': ['file.bicepparam'], \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file', 'foobar.zone'], \ 'bitbake': ['file.bb', 'file.bbappend', 'file.bbclass', 'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 'meta-layer/conf/distro/foo.conf', 'project-spec/configs/zynqmp-generic-xczu7ev.conf'], \ 'blade': ['file.blade.php'],