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,
...
}: let
inherit (lib.modules) mkIf;
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) {
vim = {
startPlugins = ["otter"];
pluginRC.trouble = entryAnywhere ''
-- Enable Otter
maps.normal = mkMerge [
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>")
];
pluginRC.otter = entryAnywhere ''
-- Enable otter diagnostics viewer
require("otter").setup {}
'';
};

View file

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

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";
};
};
};
}