kakoune/rc
Frank LENORMAND 5dc4ce5281 rc jinja: Highlight Jinja statements/expressions
This commit implements a standalone shared highlighter group that
highlights Jinja statements and expressions.

The traditional way of highlighting file contents is to hook on the
file extension, and assign a custom filetype/highlighter group to
the current buffer. However, since Jinja templates can be based on
any text file format in existence, we do not have a specific file
extension to hook, and consequently, no custom "jinja" filetype.

The user is expected to add the `jinja` highlighter whenever required:

```
require-module jinja
add-highlighter window/ ref jinja
```

Alternatively, file extensions that are known to occasionally pair
with Jinja can be hooked from the user configuration:

```
hook global WinCreate .+\.html %[
    try %[
        execute-keys -draft \%s \{%|\{\{ <ret>
        require-module jinja
        add-highlighter window/ ref jinja
    ]
]
```

The above hook auto-detects statements/expressions (respectively
{%…%} and {{…}} expansions), but will cause false positives
(in terms of highlighting), and therefore isn't part of `jinja.kak`
by default.
2020-01-08 12:22:34 +01:00
..
detection rc: Use the standard fail command to report errors 2019-11-14 08:32:55 +01:00
filetype rc jinja: Highlight Jinja statements/expressions 2020-01-08 12:22:34 +01:00
tools Slight code cleanup in grep.kak 2019-12-31 12:50:19 +11:00
windowing rc repl tmux: Do not check for the Tmux version 2019-12-10 12:15:08 +01:00