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 (supports optional args: {"include_declaration": true/false} ) |
Fold | unbound | lsp_fold (supports optional args: {"strict": true/false} - to configure whether to fold only when the caret is contained within the folded region (true ), or even when it is anywhere on the starting line (false )) |
Fold All | unbound | lsp_fold_all (supports optional args: {"kind": "comment" | "imports" | "region"} ) |
Follow Link | unbound | lsp_open_link |
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 Diagnostic | unbound suggested: f8 |
lsp_goto_diagnostic (with args: {"uri": "$view_uri"} ) |
Goto Diagnostic in Project | unbound suggested: shift f8 |
lsp_goto_diagnostic |
Goto Implementation | unbound | lsp_symbol_implementation |
Goto Symbol in Project | unbound suggested: ctrl shift r |
lsp_workspace_symbols |
Goto Symbol | unbound suggested: ctrl r |
lsp_document_symbols |
Goto Type Definition | unbound | lsp_symbol_type_definition |
Hover Popup | unbound | lsp_hover |
Insert/Replace Completions | alt enter | lsp_commit_completion_with_opposite_insert_mode |
Next Diagnostic | unbound | lsp_next_diagnostic |
Previous Diagnostic | unbound | lsp_prev_diagnostic |
Rename | unbound | lsp_symbol_rename |
Restart Server | unbound | lsp_restart_server |
Run Code Action | unbound | lsp_code_actions |
Run Code Lens | unbound | lsp_code_lens |
Run Refactor Action | unbound | lsp_code_actions (with args: {"only_kinds": ["refactor"]} ) |
Run Source Action | unbound | lsp_code_actions (with args: {"only_kinds": ["source"]} ) |
Show Call Hierarchy | unbound | lsp_call_hierarchy |
Show Type Hierarchy | unbound | lsp_type_hierarchy |
Signature Help | ctrl alt space | lsp_signature_help_show |
Toggle Diagnostics Panel | ctrl alt m | lsp_show_diagnostics_panel |
Toggle Inlay Hints | unbound | lsp_toggle_inlay_hints (supports optional args: {"enable": true/false} ) |
Toggle Log Panel | unbound | lsp_toggle_server_panel |