summaryrefslogtreecommitdiffstats
path: root/modules/plugins/ui/modes-nvim/modes-nvim.nix
blob: 4e591a05b05e37dc763732589016ef4d43d1293d (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
35
36
37
38
39
40
41
42
{lib, ...}: let
  inherit (lib.options) mkOption mkEnableOption;
  inherit (lib.types) listOf bool either str float;
  inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
  options.vim.ui.modes-nvim = {
    enable = mkEnableOption "prismatic line decorations for Neovim [modes.nvim]";

    setupOpts = mkPluginSetupOption "modes.nvim" {
      set_cursorline = mkOption {
        type = bool;
        default = false;
        description = ''
          Whether to enable cursorline initially, and disable cursorline
          for inactive windows or ignored filetypes.
        '';
      };

      line_opacity = {
        visual = mkOption {
          type = float;
          default = 0.15;
          example = 0.0;
          description = "Opacity for cursorline and number background";
        };
      };

      ignore = mkOption {
        type = listOf (either str luaInline);
        default = ["NvimTree" "TelescopePrompt" "!minifiles"];
        description = ''
          Disable modes highlights for specified filetypes or enable with
          prefix "!" if otherwise disabled.

          Can also be a function that returns a boolean value that disables modes
          highlights when `true`. Use `lib.generators.mkLuaInline` if using a Lua
          function.
        '';
      };
    };
  };
}