summaryrefslogtreecommitdiffstats
path: root/modules/plugins/languages/fluent.nix
blob: 631ba590f004c8d293857d707bac851181ef721c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  config,
  lib,
  ...
}: let
  inherit (lib.options) mkEnableOption;
  inherit (lib.modules) mkIf;

  cfg = config.vim.languages.fluent;
in {
  options.vim.languages.fluent = {
    enable = mkEnableOption "Fluent language support";
  };

  config = mkIf cfg.enable {
    vim = {
      lazy.plugins.fluent-nvim = {
        package = "fluent-nvim";
        ft = ["fluent"];
      };
      autocmds = [
        {
          event = [
            "BufRead"
            "BufNewFile"
          ];
          pattern = ["*.ftl"];
          desc = "Set fluent filetype";
          command = "set filetype=fluent";
        }
      ];
    };
  };
}