mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-07 15:54:31 +02:00
parent
e89d919e4d
commit
7c6f71199b
2 changed files with 170 additions and 107 deletions
|
@ -47,11 +47,14 @@ in
|
|||
|
||||
padding = helpers.defaultNullOpts.mkBool true "Add an extra new line on top of the list";
|
||||
|
||||
# key mappings for actions in the trouble list
|
||||
# map to {} to remove a mapping, for example:
|
||||
# close = {}
|
||||
actionKeys =
|
||||
mapAttrs
|
||||
helpers.mkCompositeOption
|
||||
''
|
||||
Key mappings for actions in the trouble list.
|
||||
Map to `{}` to remove a mapping, for example:
|
||||
`close = {};`
|
||||
''
|
||||
(mapAttrs
|
||||
(
|
||||
action: config:
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
|
@ -128,7 +131,7 @@ in
|
|||
default = "j";
|
||||
description = "Next item";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
indentLines = helpers.defaultNullOpts.mkBool true ''
|
||||
Add an indent guide below the fold icons.
|
||||
|
@ -157,8 +160,9 @@ in
|
|||
"[ \"lsp_definitions\" ]"
|
||||
"For the given modes, automatically jump if there is only a single result.";
|
||||
|
||||
# icons / text used for a diagnostic
|
||||
signs =
|
||||
helpers.mkCompositeOption "Incons/text used for the different diagnostics."
|
||||
(
|
||||
mapAttrs
|
||||
(
|
||||
diagnostic: default:
|
||||
|
@ -170,7 +174,8 @@ in
|
|||
hint = "";
|
||||
information = "";
|
||||
other = "";
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
useDiagnosticSigns = helpers.defaultNullOpts.mkBool false ''
|
||||
Enabling this will use the signs defined in your lsp client
|
||||
|
@ -192,7 +197,9 @@ in
|
|||
fold_open = cfg.foldOpen;
|
||||
fold_closed = cfg.foldClosed;
|
||||
inherit (cfg) group padding;
|
||||
action_keys = with cfg.actionKeys; {
|
||||
action_keys =
|
||||
helpers.ifNonNull' cfg.actionKeys
|
||||
(with cfg.actionKeys; {
|
||||
inherit close cancel refresh jump;
|
||||
open_split = openSplit;
|
||||
open_vsplit = openVsplit;
|
||||
|
@ -205,7 +212,7 @@ in
|
|||
open_folds = openFolds;
|
||||
toggle_fold = toggleFold;
|
||||
inherit next;
|
||||
};
|
||||
});
|
||||
indent_lines = cfg.indentLines;
|
||||
auto_open = cfg.autoOpen;
|
||||
auto_close = cfg.autoClose;
|
||||
|
|
56
tests/plugins/trouble.nix
Normal file
56
tests/plugins/trouble.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
# Empty configuration
|
||||
empty = {
|
||||
plugins.trouble.enable = true;
|
||||
};
|
||||
|
||||
# All the upstream default options of trouble
|
||||
defaults = {
|
||||
plugins.trouble = {
|
||||
enable = true;
|
||||
|
||||
position = "bottom";
|
||||
height = 10;
|
||||
width = 50;
|
||||
icons = true;
|
||||
mode = "workspace_diagnostics";
|
||||
foldOpen = "";
|
||||
foldClosed = "";
|
||||
group = true;
|
||||
padding = true;
|
||||
actionKeys = {
|
||||
close = "q";
|
||||
cancel = "<esc>";
|
||||
refresh = "r";
|
||||
jump = ["<cr>" "<tab>"];
|
||||
openSplit = ["<c-x>"];
|
||||
openVsplit = ["<c-v>"];
|
||||
openTab = ["<c-t>"];
|
||||
jumpClose = ["o"];
|
||||
toggleMode = "m";
|
||||
togglePreview = "P";
|
||||
hover = "K";
|
||||
preview = "p";
|
||||
closeFolds = ["zM" "zm"];
|
||||
openFolds = ["zR" "zr"];
|
||||
toggleFold = ["zA" "za"];
|
||||
previous = "k";
|
||||
next = "j";
|
||||
};
|
||||
indentLines = true;
|
||||
autoOpen = false;
|
||||
autoClose = false;
|
||||
autoPreview = true;
|
||||
autoFold = false;
|
||||
autoJump = ["lsp_definitions"];
|
||||
signs = {
|
||||
error = "";
|
||||
warning = "";
|
||||
hint = "";
|
||||
information = "";
|
||||
other = "";
|
||||
};
|
||||
useDiagnosticSigns = false;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue