mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-05 18:40:53 +00:00
languages/liquid: add syntax highlighting support for liquid templating
This commit is contained in:
parent
ac5cf327c8
commit
b767199273
4 changed files with 39 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ in {
|
|||
./html.nix
|
||||
./tera.nix
|
||||
./twig.nix
|
||||
./liquid.nix
|
||||
./haskell.nix
|
||||
./java.nix
|
||||
./jinja.nix
|
||||
|
|
|
|||
34
modules/plugins/languages/liquid.nix
Normal file
34
modules/plugins/languages/liquid.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption literalExpression;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.liquid;
|
||||
in {
|
||||
options.vim.languages.liquid = {
|
||||
enable = mkEnableOption "Liquid templating language support";
|
||||
|
||||
treesitter = {
|
||||
enable =
|
||||
mkEnableOption "Liquid treesitter"
|
||||
// {
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "liquid";
|
||||
};
|
||||
# TODO: if curlylint gets packaged for nix, add it.
|
||||
};
|
||||
|
||||
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