created otter file

This commit is contained in:
Soliprem 2024-09-27 09:46:30 +02:00
parent 3275ab221a
commit d61aba1e12
3 changed files with 31 additions and 11 deletions

View file

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

View file

@ -1,9 +1,6 @@
{lib, ...}: let {
inherit (lib.options) mkEnableOption; imports = [
in { ./otter.nix
options.vim.lsp = { ./config.nix
otter = { ];
enable = mkEnableOption "trouble lsp for markup languages";
};
};
} }

View file

@ -0,0 +1,14 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in {
options.vim.lsp = {
trouble = {
enable = mkEnableOption "Otter LSP Injector";
mappings = {
toggle = mkMappingOption "Activate LSP on Cursor Position [otter]" "<leader>oa";
};
};
};
}