diff --git a/modules/plugins/lsp/trouble/config.nix b/modules/plugins/lsp/trouble/config.nix index b64a9151..c41dec60 100644 --- a/modules/plugins/lsp/trouble/config.nix +++ b/modules/plugins/lsp/trouble/config.nix @@ -5,12 +5,11 @@ ... }: let inherit (lib.modules) mkIf; - inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLznBinding pushDownDefault; + inherit (lib.nvim.binds) mkKeymap pushDownDefault; cfg = config.vim.lsp; - mappingDefinitions = options.vim.lsp.trouble.mappings; - mappings = addDescriptionsToMappings cfg.trouble.mappings mappingDefinitions; + inherit (options.vim.lsp.trouble) mappings; in { config = mkIf (cfg.enable && cfg.trouble.enable) { vim = { @@ -21,12 +20,12 @@ in { cmd = "Trouble"; keys = [ - (mkSetLznBinding "n" mappings.workspaceDiagnostics "Trouble toggle diagnostics") - (mkSetLznBinding "n" mappings.documentDiagnostics "Trouble toggle diagnostics filter.buf=0") - (mkSetLznBinding "n" mappings.lspReferences "Trouble toggle lsp_references") - (mkSetLznBinding "n" mappings.quickfix "Trouble toggle quickfix") - (mkSetLznBinding "n" mappings.locList "Trouble toggle loclist") - (mkSetLznBinding "n" mappings.symbols "Trouble toggle symbols") + (mkKeymap "n" cfg.trouble.mappings.workspaceDiagnostics "Trouble toggle diagnostics" {desc = mappings.workspaceDiagnostics.description;}) + (mkKeymap "n" cfg.trouble.mappings.documentDiagnostics "Trouble toggle diagnostics filter.buf=0" {desc = mappings.documentDiagnostics.description;}) + (mkKeymap "n" cfg.trouble.mappings.lspReferences "Trouble toggle lsp_references" {desc = mappings.lspReferences.description;}) + (mkKeymap "n" cfg.trouble.mappings.quickfix "Trouble toggle quickfix" {desc = mappings.quickfix.description;}) + (mkKeymap "n" cfg.trouble.mappings.locList "Trouble toggle loclist" {desc = mappings.locList.description;}) + (mkKeymap "n" cfg.trouble.mappings.symbols "Trouble toggle symbols" {desc = mappings.symbols.description;}) ]; };