fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.63k stars 262 forks source link

Keybinding for django template comment #1298

Open kjnez opened 5 months ago

kjnez commented 5 months ago

Can I add a keybinding for django comment {% comment %} {% endcomment %}? I know you can invoke it by using "C-c C-s" (Insert snippet). But since I use it a lot, it's preferable for me to add a keybinding.

fxbois commented 5 months ago

You mean in your .emacs ?

kjnez commented 5 months ago

Yep. (web-mode-comment-style 2) is not enough for me. It does the comment but django still picks up whatever is commented during rendering (plus {# ... #}).

Another thing I noticed is that if I highlight a block, and "C-c C-s" + "comment", it becomes

{% comment __block__ %}

{% endcomment %}

I understand that this is a snippet but is it possible to change the behavior to

{% comment %}
__block__
{% endcomment %}?