Function: jinja2-mode

jinja2-mode is an interactive and natively compiled function defined in jinja2-mode.el.

Signature

(jinja2-mode)

Documentation

Major mode for editing jinja2 files

In addition to any hooks its parent mode html-mode might have run, this mode runs the hook jinja2-mode-hook, as the final or penultimate step during initialization.

C-c # jinja2-insert-comment
C-c c jinja2-close-tag
C-c t jinja2-insert-tag
C-c v jinja2-insert-var

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/w823rz5zs434n18ps4jcyc02giqk4dgd-emacs-packages-deps/share/emacs/site-lisp/elpa/jinja2-mode-20220117.807/jinja2-mode.el
;;;###autoload
(define-derived-mode jinja2-mode html-mode  "Jinja2"
  "Major mode for editing jinja2 files"
  :group 'jinja2
  ;; Disabling this because of this emacs bug:
  ;;  http://lists.gnu.org/archive/html/bug-gnu-emacs/2002-09/msg00041.html
  ;; (modify-syntax-entry ?\'  "\"" sgml-mode-syntax-table)
  (set (make-local-variable 'comment-start) "{#")
  (set (make-local-variable 'comment-start-skip) "{#")
  (set (make-local-variable 'comment-end) "#}")
  (set (make-local-variable 'comment-end-skip) "#}")
  ;; it mainly from sgml-mode font lock setting
  (set (make-local-variable 'font-lock-defaults)
       '((
          jinja2-font-lock-keywords
          jinja2-font-lock-keywords-1
          jinja2-font-lock-keywords-2
          jinja2-font-lock-keywords-3)
         nil t nil nil
         (font-lock-syntactic-keywords
          . sgml-font-lock-syntactic-keywords)))
  (set (make-local-variable 'indent-line-function) 'jinja2-indent-line))