nvf/modules/plugins/lsp/otter/config.nix
2024-09-27 09:46:30 +02:00

31 lines
747 B
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
cfg = config.vim.lsp;
self = import ./otter.nix {inherit lib;};
mappingDefinitions = self.options.vim.lsp.otter.mappings;
mappings = addDescriptionsToMappings cfg.otter.mappings mappingDefinitions;
in {
config = mkIf (cfg.enable && cfg.otter.enable) {
vim = {
startPlugins = ["otter"];
maps.normal = mkMerge [
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>")
];
pluginRC.otter = entryAnywhere ''
-- Enable otter diagnostics viewer
require("otter").setup {}
'';
};
};
}