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;};
|
2024-09-27 18:21:17 +00:00
|
|
|
mappingDefinitions = self.options.vim.lsp.otter-nvim.mappings;
|
|
|
|
mappings = addDescriptionsToMappings cfg.otter-nvim.mappings mappingDefinitions;
|
2024-09-27 07:27:58 +00:00
|
|
|
in {
|
2024-09-27 18:21:17 +00:00
|
|
|
config = mkIf (cfg.enable && cfg.otter-nvim.enable) {
|
2024-09-27 14:20:49 +00:00
|
|
|
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>")
|
|
|
|
];
|
|
|
|
|
2024-09-27 18:21:17 +00:00
|
|
|
pluginRC.otter-nvim = entryAnywhere ''
|
2024-09-27 07:46:30 +00:00
|
|
|
-- Enable otter diagnostics viewer
|
2024-09-27 08:32:07 +00:00
|
|
|
require("otter").setup()
|
2024-09-27 07:27:58 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|