Code Monkey home page Code Monkey logo

snipmate_for_django's Introduction

Installation
============

Install SnipMate:
http://www.vim.org/scripts/script.php?script_id=2540

Copy `django.snippets` and `django_template.snippets` to your snippets
directory, typically at ~/.vim/snippets.

Activate the snippets by using the filetype setting.  For example:

	:set ft=python.django

For Django templates:

	:set ft=htmldjango.html

To set these automatically each time you run vim, add the following lines to
your .vimrc:

	autocmd FileType python set ft=python.django " For SnipMate
	autocmd FileType html set ft=htmldjango.html " For SnipMate

Enjoy!

snipmate_for_django's People

Contributors

jwpeddle avatar robhudson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

snipmate_for_django's Issues

Nonstandard filetype name used for django_template

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.

html.django_template not working

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.