Commits

Ollie Rutherfurd committed 5580b02

jinja tweeks

Comments (0)

Files changed (3)

snippets/jinja.snippets

 snippet extends
 	{% extends "${1:layouts/base.html}" %}
 	${2}
+snippet for
+	{% for ${1:item} in ${2:iterable} %}
+		${3}
+	{% endfor %}
+snippet forl
+	% for ${1:item} in ${2:iterable}:
+	${3}
+	% endfor
 snippet if
 	{% if ${1} %}
 		${2}
 
 " Jinja comments
 syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
+syn match jinjaLineComment "##.*$"
 
 " Block start keywords.  A bit tricker.  We only highlight at the start of a
 " tag block and only if the name is not followed by a comma or equals sign
   HiLink jinjaString Constant
   HiLink jinjaNumber Constant
   HiLink jinjaComment Comment
+  HiLink jinjaLineComment Comment
 
   delcommand HiLink
 endif
 endfun
 
 autocmd BufNewFile,BufRead *.html,*.htm call s:SelectHTML()
+autocmd BufNewFile,BufRead *.t set filetype=cram
+
 autocmd FileType css setlocal tw=0 ts=2 sw=2 et sts=2 omnifunc=csscomplete#CompleteCSS
-au BufNewFile,BufRead *.t set filetype=cram
 autocmd FileType html setlocal tw=0 ts=2 sw=2 et sts=2 omnifunc=htmlcomplete#CompleteTags
-autocmd FileType htmljinja setlocal tw=0 ts=1 sw=1 et sts=1
+autocmd FileType htmljinja setlocal tw=0 ts=2 sw=2 et sts=2
 autocmd FileType java setlocal et ts=4 sw=4 sts=4
 autocmd FileType javascript setlocal et tw=0 ts=2 sw=2 sts=2 omnifunc=javascriptcomplete#CompleteJS
 autocmd FileType go setlocal noet ts=8 sw=8 sts=8 nolist