| 48 | | = Yasnippet = |
| | 50 | == django-mode == |
| | 51 | |
| | 52 | '''Status: old, download link does not work.''' |
| | 53 | |
| | 54 | [http://cavedoni.com/ I]’ve started hacking on an editing mode for Django templates in Emacs. (Please note that this is the first time I ever do Emacs Lisp, and that what I currently have is nothing more than a start. If you can come up with fixes or improvements, these are much appreciated). |
| | 55 | |
| | 56 | The most obvious benefit that it provides at the moment is syntax highlighting of variables and blocks. |
| | 57 | |
| | 58 | It knows about the Django default tag names and uses a different coloring for comments. At the moment it is configured to automatically kick-in for files with extension `.djhtml` (I made it up that way, in order not to clash with other defaults one may have with .html files). Of course you can invoke it with `M-x django-mode` in any buffer. |
| | 59 | |
| | 60 | You can get it here: http://unicoders.org/code/hacks/trunk/django-mode.el (link dead) |
| | 61 | |
| | 62 | Put it somewhere where Emacs can find it then add this line to your `.emacs` file: |
| | 63 | |
| | 64 | {{{ |
| | 65 | (load "django-mode.el") |
| | 66 | }}} |
| | 67 | |
| | 68 | This is a sample screenshot of the results with the “Charcoal Black” [http://www.emacswiki.org/cgi-bin/wiki?ColorTheme color theme]: |
| | 69 | |
| | 70 | {{{ |
| | 71 | #!html |
| | 72 | <img src="http://code.djangoproject.com/attachment/wiki/Emacs/emacs-django-template.png?format=raw" alt="Screenshot of Django template in GNU Emacs, Mac OS X"> |
| | 73 | }}} |
| | 74 | |
| | 75 | == django-html-mode == |
| | 76 | |
| | 77 | '''Status: unmaintained.''' |
| | 78 | |
| | 79 | There is another emacs django template mode. It is derived mode from html (sgml). |
| | 80 | |
| | 81 | There is an updated and improved version of this mode on: [https://code.edge.launchpad.net/~eopadoan/+junk/django-html-mode] |
| | 82 | * '''Updated the supported tags''' to current (django 1.0b3). |
| | 83 | * Added '''auto-close''' command ( {{{C-c ]}}} ). |
| | 84 | |
| | 85 | To get, run on a shell: |
| | 86 | {{{ |
| | 87 | bzr branch lp:~eopadoan/+junk/django-html-mode |
| | 88 | }}} |
| | 89 | |
| | 90 | Note: The django-html-mode code does not appear to support template tag indentation. |
| | 91 | |
| | 92 | |
| | 93 | == Yasnippet == |
| 78 | | |
| 79 | | == django-mode == (OLD -- download link does not work) |
| 80 | | |
| 81 | | [http://cavedoni.com/ I]’ve started hacking on an editing mode for Django templates in Emacs. (Please note that this is the first time I ever do Emacs Lisp, and that what I currently have is nothing more than a start. If you can come up with fixes or improvements, these are much appreciated). |
| 82 | | |
| 83 | | The most obvious benefit that it provides at the moment is syntax highlighting of variables and blocks. |
| 84 | | |
| 85 | | It knows about the Django default tag names and uses a different coloring for comments. At the moment it is configured to automatically kick-in for files with extension `.djhtml` (I made it up that way, in order not to clash with other defaults one may have with .html files). Of course you can invoke it with `M-x django-mode` in any buffer. |
| 86 | | |
| 87 | | You can get it here: http://unicoders.org/code/hacks/trunk/django-mode.el (link dead) |
| 88 | | |
| 89 | | Put it somewhere where Emacs can find it then add this line to your `.emacs` file: |
| 90 | | |
| 91 | | {{{ |
| 92 | | (load "django-mode.el") |
| 93 | | }}} |
| 94 | | |
| 95 | | This is a sample screenshot of the results with the “Charcoal Black” [http://www.emacswiki.org/cgi-bin/wiki?ColorTheme color theme]: |
| 96 | | |
| 97 | | {{{ |
| 98 | | #!html |
| 99 | | <img src="http://code.djangoproject.com/attachment/wiki/Emacs/emacs-django-template.png?format=raw" alt="Screenshot of Django template in GNU Emacs, Mac OS X"> |
| 100 | | }}} |
| 101 | | |
| 102 | | == django-html-mode == |
| 103 | | |
| 104 | | There is another emacs django templete mode. It is derived mode from html(sgml). |
| 105 | | |
| 106 | | === Improved version === |
| 107 | | |
| 108 | | There is an updated and improved version of this mode on: [https://code.edge.launchpad.net/~eopadoan/+junk/django-html-mode] |
| 109 | | * '''Updated the supported tags''' to current (django 1.0b3). |
| 110 | | * Added '''auto-close''' command ( {{{C-c ]}}} ). |
| 111 | | |
| 112 | | To get, run on a shell: |
| 113 | | {{{ |
| 114 | | bzr branch lp:~eopadoan/+junk/django-html-mode |
| 115 | | }}} |
| 116 | | |
| 117 | | Note: The django-html-mode code does not appear to support template tag indentation. |