2017-09-02 06:43:18 -04:00
|
|
|
if !exists("g:mako_detect_lang_from_ext")
|
|
|
|
let g:mako_detect_lang_from_ext = 1
|
|
|
|
endif
|
2022-08-08 09:45:56 -04:00
|
|
|
if !exists("g:mako_extension")
|
|
|
|
let g:mako_extension = ".mako"
|
|
|
|
endif
|
2017-09-02 06:43:18 -04:00
|
|
|
if g:mako_detect_lang_from_ext
|
2022-08-08 09:45:56 -04:00
|
|
|
exe 'au BufNewFile *.*' . g:mako_extension . ' execute "do BufNewFile filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype'
|
2017-09-02 06:43:18 -04:00
|
|
|
" 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
|
|
|
|
" filetype to be set to mason
|
2022-08-08 09:45:56 -04:00
|
|
|
exe 'au BufReadPre *.*' . g:mako_extension . ' execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype'
|
2017-09-02 06:43:18 -04:00
|
|
|
endif
|
2022-08-08 09:45:56 -04:00
|
|
|
exe 'au BufRead,BufNewFile *' . g:mako_extension . ' set filetype=mako'
|