1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins

This commit is contained in:
amix
2017-09-02 12:43:18 +02:00
parent 3be3af28e5
commit 7fc202ec88
64 changed files with 1659 additions and 525 deletions

View File

@ -1,19 +0,0 @@
This project is a colleciton of vim scripts that relate to the Mako templating
engine for python. Most of thse are not at all written by me, just packaged
here from the vim-script site. The purpose is to make them easy to use with
pathogen.vim.
About mako: http://www.makotemplates.org/
Original scripts:
Externally sourced scripts:
* indent/mako.vim (vim script 2663) by Scott Torborg
http://www.vim.org/scripts/script.php?script_id=2663
version used here: 0.4
* syntax/mako.vim (vim script 1858) by Armin Ronacher
http://www.vim.org/scripts/script.php?script_id=1858
version used here: 0.6.1

View File

@ -0,0 +1,22 @@
This project is a colleciton of vim scripts that relate to the Mako templating
engine for python. Most of thse are not at all written by me, just packaged
here from the vim-script site. The purpose is to make them easy to use with
pathogen.vim.
Useful configuration variables:
* `g:mako_detect_lang_from_ext`: when set to 1 (the default), the ftdetect
script will attempt to figure out the "outer" filetype of the file by
stripping the ".mako" extension (eg: index.html.mako will be treated as HTML,
while script.cpp.mako will be treated as C++). Set to 0 to prevent this
detection.
* `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".
About mako: http://www.makotemplates.org/
Externally sourced scripts:
* [indent/mako.vim](http://www.vim.org/scripts/script.php?script_id=2663) 0.4 by Scott Torborg
* [syntax/mako.vim](http://www.vim.org/scripts/script.php?script_id=1858) 0.6.1 by Armin Ronacher

View File

@ -1 +1,11 @@
if !exists("g:mako_detect_lang_from_ext")
let g:mako_detect_lang_from_ext = 1
endif
if g:mako_detect_lang_from_ext
au BufNewFile *.*.mako 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
" for this file, otherwise a mako tag at the start of the file can cause the
" filetype to be set to mason
au BufReadPre *.*.mako execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
endif
au BufRead,BufNewFile *.mako set filetype=mako

View File

@ -19,16 +19,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
@ -89,4 +100,4 @@ if version >= 508 || !exists("did_mako_syn_inits")
delc HiLink
endif
let b:current_syntax = "html"
let b:current_syntax = b:mako_outer_lang