-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from ksonj/lsp-mappings
lsp: make key bindings configurable
- Loading branch information
Showing
3 changed files
with
90 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,68 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
{lib, ...}: | ||
with lib; | ||
with builtins; { | ||
with builtins; let | ||
in { | ||
options.vim.lsp = { | ||
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; | ||
formatOnSave = mkEnableOption "format on save"; | ||
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"; | ||
}; | ||
}; | ||
} |