Keyboard Shortcuts

Below is a list of supported commands and the corresponding keyboard shortcut (if assigned). Most of those are also available from the Command Palette, the main menu and the mouse context menu.

Refer to the Customization section on how to modify or assign shortcuts to them.

Mac

If you using macOS, replace ctrl with command.

Feature Shortcut Command
Auto Complete ctrl space (also on macOS) auto_complete
Expand Selection unbound lsp_expand_selection
Find References shift f12 lsp_symbol_references
Format File unbound lsp_format_document
Format Selection unbound lsp_format_document_range
Goto Declaration unbound lsp_symbol_declaration
Goto Definition unbound
suggested: f12
lsp_symbol_definition
Goto Implementation unbound lsp_symbol_implementation
Goto Symbol unbound
suggested: ctrl r
lsp_document_symbols
Goto Symbol in Project unbound
suggested: ctrl shift r
lsp_workspace_symbols
Goto Type Definition unbound lsp_symbol_type_definition
Next Diagnostic F4 -
Previous Diagnostic shift F4 -
Rename unbound lsp_symbol_rename
Restart Server unbound lsp_restart_server
Run Code Action unbound lsp_code_actions
Run Source Action unbound lsp_code_actions (with args: {"only_kinds": ["source"]})
Run Code Lens unbound lsp_code_lens
Signature Help ctrl alt space -
Hover Popup unbound lsp_hover
Toggle Diagnostics Panel ctrl alt m lsp_show_diagnostics_panel
Toggle Log Panel unbound lsp_toggle_server_panel