# HG changeset patch # User Steve Losh # Date 1305041263 14400 # Node ID c925b9fad53c4424ce743deeabba95d6a47bd000 # Parent 54f00c6bfa64faa09e1fd2886c5bd170c2aa0a5d vim: can I start drinking yet? diff -r 54f00c6bfa64 -r c925b9fad53c vim/bundle/django-custom/ftplugin/django.vim --- a/vim/bundle/django-custom/ftplugin/django.vim Tue May 10 10:36:10 2011 -0400 +++ b/vim/bundle/django-custom/ftplugin/django.vim Tue May 10 11:27:43 2011 -0400 @@ -1,25 +1,29 @@ -" Vim syntax file -" Language: Django template -" Maintainer: Dave Hodder -" Last Change: 2009 Jan 12 +" The django/python/htmldjango filetype situation is a gigantic clusterfuck. +" +" This file contains stuff for htmldjango files, but is named django.vim because the +" htmldjango.vim file that ships with vim sources html.vim and django.vim. +" +" Of course, using python.django for the Python files ALSO sources django.vim. +" +" Awesome. -" matchit.vim (extended "%" matching) contributed by Michael Brown. -" Borrowed from html.vim Thanks to Johannes Zellner and Benji Fisher. -if exists("loaded_matchit") - let b:match_ignorecase = 1 - let b:match_skip = 's:Comment' - let b:match_words = '<:>,' . - \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . - \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . - \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' . - \ '{% *if .*%}:{% *else *%}:{% *endif *%},' . - \ '{% *ifequal .*%}:{% *else *%}:{% *endifequal *%},' . - \ '{% *ifnotequal .*%}:{% *else *%}:{% *endifnotequal *%},' . - \ '{% *ifchanged .*%}:{% *else *%}:{% *endifchanged *%},' . - \ '{% *for .*%}:{% *endfor *%},' . - \ '{% *with .*%}:{% *endwith *%},' . - \ '{% *comment .*%}:{% *endcomment *%},' . - \ '{% *block .*%}:{% *endblock *%},' . - \ '{% *filter .*%}:{% *endfilter *%},' . - \ '{% *spaceless .*%}:{% *endspaceless *%}' +if (&ft == "htmldjango") + if exists("loaded_matchit") + let b:match_ignorecase = 1 + let b:match_skip = 's:Comment' + let b:match_words = '<:>,' . + \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . + \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . + \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' . + \ '{% *if .*%}:{% *else *%}:{% *endif *%},' . + \ '{% *ifequal .*%}:{% *else *%}:{% *endifequal *%},' . + \ '{% *ifnotequal .*%}:{% *else *%}:{% *endifnotequal *%},' . + \ '{% *ifchanged .*%}:{% *else *%}:{% *endifchanged *%},' . + \ '{% *for .*%}:{% *endfor *%},' . + \ '{% *with .*%}:{% *endwith *%},' . + \ '{% *comment .*%}:{% *endcomment *%},' . + \ '{% *block .*%}:{% *endblock *%},' . + \ '{% *filter .*%}:{% *endfilter *%},' . + \ '{% *spaceless .*%}:{% *endspaceless *%}' + endif endif