2023-11-08 03:16:46 +01:00
|
|
|
{lib, ...}: let
|
2024-03-12 01:46:29 +01:00
|
|
|
inherit (lib.options) mkEnableOption;
|
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2023-10-22 21:38:14 +02:00
|
|
|
in {
|
2023-02-27 20:25:39 +01:00
|
|
|
options.vim.lsp = {
|
2023-04-17 22:27:27 +02:00
|
|
|
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options";
|
|
|
|
formatOnSave = mkEnableOption "format on save";
|
2023-10-22 21:38:14 +02: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 15:01:34 +02:00
|
|
|
toggleFormatOnSave =
|
|
|
|
mkMappingOption "Toggle format on save"
|
|
|
|
"<leader>ltf";
|
2023-10-22 21:38:14 +02:00
|
|
|
};
|
2023-02-27 20:25:39 +01:00
|
|
|
};
|
|
|
|
}
|