mirror of
1
0
Fork 0

Update vim-bundle-mako.

This commit is contained in:
Kurtis Moxley 2022-05-19 22:47:51 +08:00
parent 0883030a2b
commit 016f7f3469
2 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,7 @@ Useful configuration variables:
detection. detection.
* `g:mako_default_outer_lang`: if ftdetect cannot detect the "outer" filetype of * `g:mako_default_outer_lang`: if ftdetect cannot detect the "outer" filetype of
the file, this sets the default filetype used. If not set, defaults to "html". the file, this sets the default filetype used. If not set, defaults to "html".
* `g:mako_extension`: set to the default string (with leading dot). Default is ".mako"
About mako: http://www.makotemplates.org/ About mako: http://www.makotemplates.org/

View File

@ -1,11 +1,14 @@
if !exists("g:mako_detect_lang_from_ext") if !exists("g:mako_detect_lang_from_ext")
let g:mako_detect_lang_from_ext = 1 let g:mako_detect_lang_from_ext = 1
endif endif
if !exists("g:mako_extension")
let g:mako_extension = ".mako"
endif
if g:mako_detect_lang_from_ext if g:mako_detect_lang_from_ext
au BufNewFile *.*.mako execute "do BufNewFile filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype exe 'au BufNewFile *.*' . g:mako_extension . ' execute "do BufNewFile filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype'
" it's important to get this before any of the normal BufRead autocmds execute " it's important to get this before any of the normal BufRead autocmds execute
" for this file, otherwise a mako tag at the start of the file can cause the " for this file, otherwise a mako tag at the start of the file can cause the
" filetype to be set to mason " filetype to be set to mason
au BufReadPre *.*.mako execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype exe 'au BufReadPre *.*' . g:mako_extension . ' execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype'
endif endif
au BufRead,BufNewFile *.mako set filetype=mako exe 'au BufRead,BufNewFile *' . g:mako_extension . ' set filetype=mako'