mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-02 00:55:54 +00:00
languages/tera: add syntax highlighting support for tera templating
This commit is contained in:
parent
0eeb3f2b6c
commit
75b8173a4b
3 changed files with 30 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ isMaximal: {
|
||||||
|
|
||||||
tailwind.enable = false;
|
tailwind.enable = false;
|
||||||
svelte.enable = false;
|
svelte.enable = false;
|
||||||
|
tera.enable = false;
|
||||||
|
|
||||||
# Nim LSP is broken on Darwin and therefore
|
# Nim LSP is broken on Darwin and therefore
|
||||||
# should be disabled by default. Users may still enable
|
# should be disabled by default. Users may still enable
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ in {
|
||||||
./helm.nix
|
./helm.nix
|
||||||
./kotlin.nix
|
./kotlin.nix
|
||||||
./html.nix
|
./html.nix
|
||||||
|
./tera.nix
|
||||||
./haskell.nix
|
./haskell.nix
|
||||||
./java.nix
|
./java.nix
|
||||||
./json.nix
|
./json.nix
|
||||||
|
|
|
||||||
28
modules/plugins/languages/tera.nix
Normal file
28
modules/plugins/languages/tera.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.tera;
|
||||||
|
in {
|
||||||
|
options.vim.languages.tera = {
|
||||||
|
enable = mkEnableOption "Tera templating language support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "Tera treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "tera";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue