mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugin/lsp: automatic keymap description
Add keymaps default descriptions for lsp buf and diagnostics Change-Id: I7a48ef3760e530a738efd7036b7ae5722c054256
This commit is contained in:
parent
838829c8f9
commit
d867aaea43
1 changed files with 9 additions and 0 deletions
|
@ -198,6 +198,14 @@ in
|
|||
let
|
||||
actionStr = action.action or action;
|
||||
actionProps = optionalAttrs (isAttrs action) (removeAttrs action [ "action" ]);
|
||||
desc =
|
||||
let
|
||||
split = splitString "." prefix;
|
||||
splitlen = length split;
|
||||
prefixFinal = (elemAt split (splitlen - 2)) + " ";
|
||||
optPrefix = optionalString (splitlen > 2) prefixFinal;
|
||||
in
|
||||
"Lsp " + optPrefix + actionStr;
|
||||
in
|
||||
{
|
||||
mode = "n";
|
||||
|
@ -206,6 +214,7 @@ in
|
|||
|
||||
options = {
|
||||
inherit (cfg.keymaps) silent;
|
||||
inherit desc;
|
||||
} // actionProps;
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue