2023-02-01 20:11:37 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2024-11-04 16:50:50 +01:00
|
|
|
options,
|
2023-02-01 20:11:37 +01:00
|
|
|
...
|
2023-11-08 03:16:46 +01:00
|
|
|
}: let
|
2024-11-04 16:50:50 +01:00
|
|
|
inherit (lib.modules) mkIf;
|
2024-11-17 19:48:40 +01:00
|
|
|
inherit (lib.nvim.binds) mkKeymap pushDownDefault;
|
2023-11-08 03:16:46 +01:00
|
|
|
|
2023-02-01 20:11:37 +01:00
|
|
|
cfg = config.vim.lsp;
|
2023-05-02 23:28:40 +02:00
|
|
|
|
2024-11-17 19:48:40 +01:00
|
|
|
inherit (options.vim.lsp.trouble) mappings;
|
2023-02-01 20:11:37 +01:00
|
|
|
in {
|
|
|
|
config = mkIf (cfg.enable && cfg.trouble.enable) {
|
2024-03-12 01:46:29 +01:00
|
|
|
vim = {
|
2024-11-04 16:50:50 +01:00
|
|
|
lazy.plugins.trouble = {
|
|
|
|
package = "trouble";
|
|
|
|
setupModule = "trouble";
|
|
|
|
inherit (cfg.trouble) setupOpts;
|
2023-02-01 20:11:37 +01:00
|
|
|
|
2024-11-04 16:50:50 +01:00
|
|
|
cmd = "Trouble";
|
|
|
|
keys = [
|
2024-11-17 19:48:40 +01:00
|
|
|
(mkKeymap "n" cfg.trouble.mappings.workspaceDiagnostics "<cmd>Trouble toggle diagnostics<CR>" {desc = mappings.workspaceDiagnostics.description;})
|
|
|
|
(mkKeymap "n" cfg.trouble.mappings.documentDiagnostics "<cmd>Trouble toggle diagnostics filter.buf=0<CR>" {desc = mappings.documentDiagnostics.description;})
|
|
|
|
(mkKeymap "n" cfg.trouble.mappings.lspReferences "<cmd>Trouble toggle lsp_references<CR>" {desc = mappings.lspReferences.description;})
|
|
|
|
(mkKeymap "n" cfg.trouble.mappings.quickfix "<cmd>Trouble toggle quickfix<CR>" {desc = mappings.quickfix.description;})
|
|
|
|
(mkKeymap "n" cfg.trouble.mappings.locList "<cmd>Trouble toggle loclist<CR>" {desc = mappings.locList.description;})
|
|
|
|
(mkKeymap "n" cfg.trouble.mappings.symbols "<cmd>Trouble toggle symbols<CR>" {desc = mappings.symbols.description;})
|
2024-11-04 16:50:50 +01:00
|
|
|
];
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
|
2024-03-12 01:46:29 +01:00
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
|
|
"<leader>x" = "+Trouble";
|
2024-11-10 19:52:12 +01:00
|
|
|
"<leader>lw" = "+Workspace";
|
2024-03-12 01:46:29 +01:00
|
|
|
};
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
};
|
|
|
|
}
|