summaryrefslogtreecommitdiffstats
path: root/modules/plugins/lsp/otter/config.nix
blob: bf335169e0c89ede633146b52598e7cd2e4915e7 (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
{
  config,
  lib,
  options,
  ...
}: let
  inherit (lib.modules) mkIf;
  inherit (lib.nvim.binds) mkKeymap;

  cfg = config.vim.lsp;

  inherit (options.vim.lsp.otter-nvim) mappings;
in {
  config = mkIf (cfg.enable && cfg.otter-nvim.enable) {
    vim.lazy.plugins = {
      "otter-nvim" = {
        package = "otter-nvim";
        setupModule = "otter";
        inherit (cfg.otter-nvim) setupOpts;

        cmd = ["OtterActivate" "OtterDeactivate" "OtterExport" "OtterExportAs"];

        keys = [(mkKeymap "n" cfg.otter-nvim.mappings.toggle "<cmd>OtterActivate<CR>" {desc = mappings.toggle.description;})];
      };
    };
  };
}