From c667df83fa866b21a305b8c538114b2ecb8083e6 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 20 Jan 2023 15:18:11 -0800 Subject: [PATCH] add gohtmltmpl fix to vim config --- .vim/filetype.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.vim/filetype.vim b/.vim/filetype.vim index 7ab5a03..09676a1 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -130,3 +130,14 @@ augroup end augroup rust autocmd FileType rust nnoremap lg lua rust_where_at_line() augroup end + +function DetectGoHtmlTmpl() + if expand('%:e') == "html" && search("{{") != 0 + setfiletype gohtmltmpl + endif +endfunction + +augroup filetypedetect + " gohtmltmpl + au BufRead,BufNewFile *.html call DetectGoHtmlTmpl() +augroup END