summaryrefslogtreecommitdiffstats
path: root/syntax/mako.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2017-09-27 19:57:29 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2017-09-27 19:57:29 +0200
commit8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8 (patch)
tree125734ac66307a962eeda16283355dde0d0fbd2e /syntax/mako.vim
parent9bfde7574aa89a91b80ed9c993fc000cfc11aae7 (diff)
downloadvim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.tar.gz
vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.zip
Update
Diffstat (limited to 'syntax/mako.vim')
-rw-r--r--syntax/mako.vim25
1 files changed, 18 insertions, 7 deletions
diff --git a/syntax/mako.vim b/syntax/mako.vim
index 7a9eb654..0a2399b0 100644
--- a/syntax/mako.vim
+++ b/syntax/mako.vim
@@ -21,16 +21,27 @@ elseif exists("b:current_syntax")
finish
endif
+if !exists("b:mako_outer_lang")
+ if exists("g:mako_default_outer_lang")
+ let b:mako_outer_lang = g:mako_default_outer_lang
+ else
+ let b:mako_outer_lang = "html"
+ endif
+endif
if !exists("main_syntax")
- let main_syntax = "html"
+ let main_syntax = b:mako_outer_lang
endif
-"Source the html syntax file
-ru! syntax/html.vim
-unlet b:current_syntax
+"Source the outer syntax file
+execute "ru! syntax/" . b:mako_outer_lang . ".vim"
+if exists("b:current_syntax")
+ unlet b:current_syntax
+endif
-" tell html.vim what syntax groups should take precedence (see :help html.vim)
-syn cluster htmlPreproc add=makoLine,makoVariable,makoTag,makoDocComment,makoDefEnd,makoText,makoDelim,makoEnd,makoComment,makoEscape
+if b:mako_outer_lang == "html"
+ " tell html.vim what syntax groups should take precedence (see :help html.vim)
+ syn cluster htmlPreproc add=makoLine,makoVariable,makoTag,makoDocComment,makoDefEnd,makoText,makoDelim,makoEnd,makoComment,makoEscape
+endif
"Put the python syntax file in @pythonTop
syn include @pythonTop syntax/python.vim
@@ -91,6 +102,6 @@ if version >= 508 || !exists("did_mako_syn_inits")
delc HiLink
endif
-let b:current_syntax = "html"
+let b:current_syntax = b:mako_outer_lang
endif