2023-11-08 02:16:46 +00:00
|
|
|
{lib, ...}: let
|
2024-03-12 00:46:29 +00:00
|
|
|
inherit (lib.options) mkEnableOption;
|
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2023-10-22 19:38:14 +00:00
|
|
|
in {
|
2023-02-27 19:25:39 +00:00
|
|
|
options.vim.lsp = {
|
2023-04-17 20:27:27 +00:00
|
|
|
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options";
|
|
|
|
formatOnSave = mkEnableOption "format on save";
|
2023-10-22 19:38:14 +00:00
|
|
|
mappings = {
|
|
|
|
goToDefinition =
|
|
|
|
mkMappingOption "Go to definition"
|
|
|
|
"<leader>lgd";
|
|
|
|
goToDeclaration =
|
|
|
|
mkMappingOption "Go to declaration"
|
|
|
|
"<leader>lgD";
|
|
|
|
goToType =
|
|
|
|
mkMappingOption "Go to type"
|
|
|
|
"<leader>lgt";
|
|
|
|
listImplementations =
|
|
|
|
mkMappingOption "List implementations"
|
|
|
|
"<leader>lgi";
|
|
|
|
listReferences =
|
|
|
|
mkMappingOption "List references"
|
|
|
|
"<leader>lgr";
|
|
|
|
nextDiagnostic =
|
|
|
|
mkMappingOption "Go to next diagnostic"
|
|
|
|
"<leader>lgn";
|
|
|
|
previousDiagnostic =
|
|
|
|
mkMappingOption "Go to previous diagnostic"
|
|
|
|
"<leader>lgp";
|
|
|
|
openDiagnosticFloat =
|
|
|
|
mkMappingOption "Open diagnostic float"
|
|
|
|
"<leader>le";
|
|
|
|
documentHighlight =
|
|
|
|
mkMappingOption "Document highlight"
|
|
|
|
"<leader>lH";
|
|
|
|
listDocumentSymbols =
|
|
|
|
mkMappingOption "List document symbols"
|
|
|
|
"<leader>lS";
|
|
|
|
addWorkspaceFolder =
|
|
|
|
mkMappingOption "Add workspace folder"
|
|
|
|
"<leader>lwa";
|
|
|
|
removeWorkspaceFolder =
|
|
|
|
mkMappingOption "Remove workspace folder"
|
|
|
|
"<leader>lwr";
|
|
|
|
listWorkspaceFolders =
|
|
|
|
mkMappingOption "List workspace folders"
|
|
|
|
"<leader>lwl";
|
|
|
|
listWorkspaceSymbols =
|
|
|
|
mkMappingOption "List workspace symbols"
|
|
|
|
"<leader>lws";
|
|
|
|
hover =
|
|
|
|
mkMappingOption "Trigger hover"
|
|
|
|
"<leader>lh";
|
|
|
|
signatureHelp =
|
|
|
|
mkMappingOption "Signature help"
|
|
|
|
"<leader>ls";
|
|
|
|
renameSymbol =
|
|
|
|
mkMappingOption "Rename symbol"
|
|
|
|
"<leader>ln";
|
|
|
|
codeAction =
|
|
|
|
mkMappingOption "Code action"
|
|
|
|
"<leader>la";
|
|
|
|
format =
|
|
|
|
mkMappingOption "Format"
|
|
|
|
"<leader>lf";
|
2023-10-14 13:01:34 +00:00
|
|
|
toggleFormatOnSave =
|
|
|
|
mkMappingOption "Toggle format on save"
|
|
|
|
"<leader>ltf";
|
2023-10-22 19:38:14 +00:00
|
|
|
};
|
2023-02-27 19:25:39 +00:00
|
|
|
};
|
|
|
|
}
|