Skip to content

Commit ed82ddd

Browse files
committed
languages/tera: add syntax highlighting support for tera templating
1 parent 1481131 commit ed82ddd

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
@@ -95,6 +95,7 @@ isMaximal: {
9595

9696
tailwind.enable = false;
9797
svelte.enable = false;
98+
tera.enable = false;
9899

99100
# Nim LSP is broken on Darwin and therefore
100101
# 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
@@ -151,6 +151,9 @@
151151
- Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in
152152
`languages.lua`.
153153
154+
- Added [tera](https://keats.github.io/tera/) language support (syntax
155+
highlighting only).
156+
154157
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
155158
https://github.com/gorbit99/codewindow.nvim
156159

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)