Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added autorecognition and html syntax support to jinja configuration #5039

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions rc/filetype/jinja.kak
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
# https://palletsprojects.com/p/jinja/
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

hook global BufCreate .*\.jinja %{
set-option buffer filetype jinja
}

hook global WinSetOption filetype=jinja %{
require-module jinja
add-highlighter window/jinja ref jinja
hook -once -always window WinSetOption filetype=.* %{
remove-highlighter window/jinja
}
}

provide-module jinja %[

require-module python
require-module html

# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾

add-highlighter shared/jinja regions
add-highlighter shared/jinja/html default-region ref html
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jinja is not necessarily a html template though, could be any language, why use html here ?

add-highlighter shared/jinja/comment region '\{#' '#\}' fill comment

# TODO: line statements # …
Expand Down