From a58031863e8ee7ba218741350b1a35cd87a3f6a0 Mon Sep 17 00:00:00 2001 From: Knyffen Date: Fri, 27 Oct 2023 10:10:39 +0200 Subject: [PATCH] Enable swapping commentstrings between HTML and GLSL shaders --- init.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.vim b/init.vim index 3d0c077..db810f5 100644 --- a/init.vim +++ b/init.vim @@ -813,6 +813,13 @@ augroup CustomCommentDefinitions setlocal commentstring=\/\/\ %s endif endif + if &ft == 'html' + if join(syntaxGroups, ',') =~ 'ShaderScript' + setlocal commentstring=\/\/\ %s + elseif join(syntaxGroups, ',') =~ 'html' + setlocal commentstring= + endif + endif endfunction autocmd! @@ -826,7 +833,7 @@ augroup CustomCommentDefinitions autocmd FileType dot setlocal commentstring=\/\/\ %s autocmd FileType markdown setlocal commentstring= autocmd FileType html.epl setlocal commentstring=%#\ %s - autocmd FileType vue execute 'autocmd CustomCommentDefinitions CursorMoved :call SetCommentString()' + autocmd FileType vue,html execute 'autocmd CustomCommentDefinitions CursorMoved :call SetCommentString()' " autocmd CursorMoved * :call SetCommentString() augroup END