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, "output_mode": "output_panel" | "quick_panel"}.
Triggering from context menus while holding ctrl opens in "side by side" mode. Holding shift triggers opposite behavior relative to what show_references_in_quick_panel is set to.
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"]}.
Save All unbound lsp_save_all
Supports optional args {"only_files": true | false} - whether to ignore buffers which have no associated file on disk.
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