mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-30 08:36:46 +00:00
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
options,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLznBinding pushDownDefault;
|
|
|
|
cfg = config.vim.lsp;
|
|
|
|
mappingDefinitions = options.vim.lsp.trouble.mappings;
|
|
mappings = addDescriptionsToMappings cfg.trouble.mappings mappingDefinitions;
|
|
in {
|
|
config = mkIf (cfg.enable && cfg.trouble.enable) {
|
|
vim = {
|
|
lazy.plugins.trouble = {
|
|
package = "trouble";
|
|
setupModule = "trouble";
|
|
inherit (cfg.trouble) setupOpts;
|
|
|
|
cmd = "Trouble";
|
|
keys = [
|
|
(mkSetLznBinding mappings.workspaceDiagnostics "<cmd>Trouble toggle diagnostics<CR>")
|
|
(mkSetLznBinding mappings.documentDiagnostics "<cmd>Trouble toggle diagnostics filter.buf=0<CR>")
|
|
(mkSetLznBinding mappings.lspReferences "<cmd>Trouble toggle lsp_references<CR>")
|
|
(mkSetLznBinding mappings.quickfix "<cmd>Trouble toggle quickfix<CR>")
|
|
(mkSetLznBinding mappings.locList "<cmd>Trouble toggle loclist<CR>")
|
|
(mkSetLznBinding mappings.symbols "<cmd>Trouble toggle symbols<CR>")
|
|
];
|
|
};
|
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
"<leader>x" = "+Trouble";
|
|
"<leader>lw" = "+Workspace";
|
|
};
|
|
};
|
|
};
|
|
}
|