robhudson / snipmate_for_django Goto Github PK
View Code? Open in Web Editor NEWDjango snippets for SnipMate, the excellent Vim plugin
Django snippets for SnipMate, the excellent Vim plugin
Since at least version 7.0 the vim runtime has shipped with syntax files for django templates, syntax/django.vim
(svn) and syntax/htmldjango.vim
(svn). syntax/django.vim
is the syntax file for django templates, syntax/htmldjango.vim
is a helper file that loads both the html syntax and django template syntax together. They are slightly different versions of the django syntax files on vim.org.
This means that django
and htmldjango
are now the standard filetype names for django templates in vim. Following your instructions to set the filetype to python.django
actually tells vim that the file is both a python file and django template. This isn't really a problem since the python syntax runs first and the django syntax refuses to run if any other syntax has already run, so it doesn't actually have any effect.
However, setting the template filetype to html.django_template
causes the problem of not loading the django template syntax file at all! The correct filetype should be htmldjango
, or if you want to retain snipmate's html snippets htmldjango.html
(htmldjango
must be first else the syntax/html.vim
syntax runs first and preempts the syntax/htmldjango.vim
syntax).
Currently you can get all of the Django syntax, snipmate's html snippets, and snipmate_for_django's snippets with the filetype htmldjango.html.djanto_template
, but that's a bit silly.
You should consider renaming the django_template.snippet to be htmldjango.snippet, and changing the README to recommend the correct filetype of htmldjango.html
.
If you install this snippets, the TagList plugin http://www.vim.org/scripts/script.php?script_id=273 don't show the tags in python
Hello,
I have added these two lines to my vimrc:
autocmd FileType python set ft=python.django " For SnipMate
autocmd FileType html set ft=html.django_template " For SnipMate
But only the django snippets are working. I can make the django_html work.
But if I type:
:set ft=html.django_template
when I'm in Vim, it works.
Do you know what's going on?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.