jinja2-mode
jinja2-mode copied to clipboard
Wishlist: minor mode
I use jinja2 in tons of places that aren't HTML - basically everywhere in Ansible or Salt. Stuff like YAML and RC files where I'd still like to have syntax highlighting and major modes for those files, but also take advantage of the work you've done for my {{ blocks }}
. Do you think a minor mode is even possible with this code? Would it be a lot of work to add?
I'm trying to do this, I've got this so far but it doesn't work, any ideas?
(setq kwds `(,jinja2-font-lock-keywords
,jinja2-font-lock-keywords-1
,jinja2-font-lock-keywords-2
,jinja2-font-lock-keywords-3))
(define-minor-mode blah-mode
"doc string"
nil " blah" nil
(if blah-mode
(font-lock-add-keywords nil kwds)
(font-lock-remove-keywords nil kwds))
(if (fboundp 'font-lock-flush)
(font-lock-flush)
(when font-lock-mode
(with-no-warnings (font-lock-fontify-buffer)))))
It would be really useful to be able to use this mode together with yaml-mode
for SaltStack and will interest other people.
Although it's possible to have a very basic jinja2 highlighting with mmm-jinja2
it isn't complete at all.
Since I had to start working with jinja2 and had the need for something like this mode, I started merging pull requests and ideas at https://gitweb.krosos.org/emacs-jinja2-mode-ng0/ feel free to send git-format patches to one of the addresses at https://krosos.org/ng0/
Do you want maintainer rights to this repo instead?
On Sun, Sep 24, 2017, 18:27 ng0 [email protected] wrote:
Since I had to start working with jinja2 and had the need for something like this mode, I started merging pull requests and ideas at https://gitweb.krosos.org/emacs-jinja2-mode-ng0/ feel free to send git-format patches to one of the addresses at https://krosos.org/ng0/
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paradoxxxzero/jinja2-mode/issues/12#issuecomment-331721267, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQjKK8VNIaITojNEpVeiETNSShpTkXdks5sloL8gaJpZM4DxbAW .
I have some strong feelings about github. Unless I can avoid it, I prefer decentralized work with git remotes for small projects.
And I'm still not 100% sure wether I'll be able to keep development steady. It's my first look into writing modes after just using emacs for years. Can't do anything more than to just do it.
Alright, if you can, just make PR from your git and I'll try to merge them. If anyone else wants to become the next maintainer, just ask
On Sun, Sep 24, 2017, 18:55 ng0 [email protected] wrote:
I have some strong feelings about github. Unless I can avoid it, I prefer decentralized work with git remotes for small projects.
And I'm still not 100% sure wether I'll be able to keep development steady. It's my first look into writing modes after just using emacs for years. Can't do anything more than to just do it.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/paradoxxxzero/jinja2-mode/issues/12#issuecomment-331723342, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQjKO_mEXBC5SrUP06JvanWub0qaq_-ks5slolZgaJpZM4DxbAW .
I have some strong feelings about github. Unless I can avoid it, I prefer decentralized work with git remotes for small projects.
Now this decentralized work is just lost. Does anyone have any progress with the topic?
I made some / limited changes at https://github.com/teknokatze/jinja2-mode-ng0 or whatever I called it. It might still be out of sync as I moved from git to hg to git in the last years and use github as a mirror to showcase.
Edit: https://github.com/teknokatze/emacs-jinja2-mode
Edit2: I have limited time for open source besides my main projects, I've just added to jinja2-mode what I needed for my last job where I used jinja2. Another approach could be to just move this original repository to a group and then changes (if there are still some to be made) can be done with more committers and/or discussion.