mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-30 16:46:45 +00:00
39 lines
995 B
Nix
39 lines
995 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) {
|
|
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
|
|
'';
|
|
}
|
|
];
|
|
vim = {
|
|
startPlugins = ["otter-nvim"];
|
|
|
|
maps.normal = mkMerge [
|
|
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>")
|
|
];
|
|
|
|
pluginRC.otter = entryAnywhere ''
|
|
-- Enable otter diagnostics viewer
|
|
require("otter").setup()
|
|
'';
|
|
};
|
|
};
|
|
}
|