nvf/modules/plugins/lsp/otter/config.nix

31 lines
747 B
Nix
Raw Normal View History

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