Update 2024-12-16 19:13 OpenBSD/amd64-t14
This commit is contained in:
16
.vim/pack/plugins/start/vim-hugo/ftdetect/html.vim
Normal file
16
.vim/pack/plugins/start/vim-hugo/ftdetect/html.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
function! s:DetectGoTemplate()
|
||||
if findfile('.hugo_build.lock', '.;') !=# ''
|
||||
set ft=htmlhugo
|
||||
elseif search('{{\s*end\s*}}')
|
||||
set ft=htmlhugo
|
||||
elseif search('{{\s*$\k\+\s*:=')
|
||||
set ft=htmlhugo
|
||||
elseif search('{{\s*\.[A-Z]')
|
||||
set ft=htmlhugo
|
||||
endif
|
||||
endfunction
|
||||
|
||||
augroup DetectGoTemplate
|
||||
autocmd!
|
||||
autocmd BufNewFile,BufRead *.html call <SID>DetectGoTemplate()
|
||||
augroup END
|
||||
Reference in New Issue
Block a user