Skip to content

Commit 4a250dc

Browse files
committed
languages/tera: add syntax highlighting support for tera templating
1 parent e0f6fe7 commit 4a250dc

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

configuration.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ isMaximal: {
9494

9595
tailwind.enable = false;
9696
svelte.enable = false;
97+
tera.enable = false;
9798

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

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@
2323
[ccc.nvim]: https://github.com/uga-rosa/ccc.nvim
2424

2525
- Added [ccc.nvim] option {option}`vim.utility.ccc.setupOpts` with the existing
26-
hard-coded options as default values.
26+
hard-coded options as default values
27+
28+
[Snoweuph](https://github.com/snoweuph):
29+
30+
- Added [tera](https://keats.github.io/tera/) language support (syntax highlighting only).
31+

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
./json.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)