LSP is an open protocol supported by many code editors (including Nvpunk) to provide language specific features, including:
Nvpunk preinstalls some language servers, to install more language servers, or to update the ones you have already installed, you can use the Mason package manager with the following command:
:Mason
Or use the Mason Package Manager button in the greeter.
This will open up the Mason popup. From here you will be able to install, remove and update your language servers.
Type g?
inside the Mason window to get an overview of its specific commands.
When a language server is available for your language, a set of LSP sepcific key maps will be enabled:
Shortcut | Action |
---|---|
gD | Go to declaration |
gd | Go to definition |
gr | Go to references |
gI | Go to implementation |
K | Information on the symbol under the cursor |
<C-k> | Signature help |
<space>rn | Refactor → rename |
<space>e | Expand diagnostics under the cursor |
]d | Next diagnostic |
[d | Previous diagnostic |
<space>ca | Code actions |
<space>vd | Disable virtual text |
<space>ve | Enable virtual text |
<space>f | Format code |