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

39 lines
995 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) {
assertions = [
{
assertion = !config.vim.utility.ccc.enable;
message = ''
ccc and otter have a breaking conflict. It's been reported upstream. Until it's fixed, disable one of them
'';
}
];
2024-09-27 07:27:58 +00:00
vim = {
2024-09-27 08:32:07 +00:00
startPlugins = ["otter-nvim"];
2024-09-27 07:27:58 +00:00
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 08:32:07 +00:00
require("otter").setup()
2024-09-27 07:27:58 +00:00
'';
};
};
}