Skip to content

Commit c64645a

Browse files
committed
languages/tera: add syntax highlighting support for tera templating
1 parent 866b983 commit c64645a

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

configuration.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ isMaximal: {
9696
jinja.enable = false;
9797
tailwind.enable = false;
9898
svelte.enable = false;
99+
tera.enable = false;
99100

100101
# Nim LSP is broken on Darwin and therefore
101102
# should be disabled by default. Users may still enable

docs/manual/release-notes/rl-0.9.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
162162
- Added XML syntax highlighting, LSP support and formatting
163163
164+
- Added [tera](https://keats.github.io/tera/) language support (syntax
165+
highlighting only).
166+
164167
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
165168
https://github.com/gorbit99/codewindow.nvim
166169

modules/plugins/languages/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ in {
1919
./helm.nix
2020
./kotlin.nix
2121
./html.nix
22+
./tera.nix
2223
./haskell.nix
2324
./java.nix
2425
./jinja.nix

modules/plugins/languages/tera.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
config,
3+
pkgs,
4+
lib,
5+
...
6+
}: let
7+
inherit (lib.options) mkEnableOption;
8+
inherit (lib.modules) mkIf mkMerge;
9+
inherit (lib.nvim.types) mkGrammarOption;
10+
11+
cfg = config.vim.languages.tera;
12+
in {
13+
options.vim.languages.tera = {
14+
enable = mkEnableOption "Tera templating language support";
15+
16+
treesitter = {
17+
enable = mkEnableOption "Tera treesitter" // {default = config.vim.languages.enableTreesitter;};
18+
package = mkGrammarOption pkgs "tera";
19+
};
20+
};
21+
22+
config = mkIf cfg.enable (mkMerge [
23+
(mkIf cfg.treesitter.enable {
24+
vim.treesitter.enable = true;
25+
vim.treesitter.grammars = [cfg.treesitter.package];
26+
})
27+
]);
28+
}

0 commit comments

Comments
 (0)