Skip to content

Latest commit

 

History

History
173 lines (104 loc) · 5.09 KB

VSCode_macOS.md

File metadata and controls

173 lines (104 loc) · 5.09 KB

Reference:

General

Switch to a different workspace Ctrl-R

Open command palette Cmd-Shift-P

Open file picker Cmd-P Switch to previous file Cmd-P Cmd-P... Go to symbol Cmd-T Go to Symbol in Editor Cmd-Shift-O Go to Symbol in Editor (grouped) Cmd-Shift-O :

Focus explorer / editor Cmd-Shift-E Focus sidebar Cmd-0 (zero) Focus in/out of terminal Ctrl-backtick

More terminal shortcuts here: https://www.mcieslar.com/learn-these-keyboard-shortcuts-to-become-a-vs-code-ninja

Toggle panel below editor Cmd-J Toggle sidebar panel Cmd-B

Save All Cmd-Opt-S

Open settings Cmd-, Open keyboard shortcuts Cmd-K Cmd-S

Switch Window (between projects) Ctrl-W Open Recent (project) Ctrl-R (hold Cmd when selecting, to open in a new window)

New File Cmd-N

New Window Cmd-Shift-N Close Window Cmd-Shift-W

Change focus to a different panel Ctrl-Q

Editing

Autocomplete / suggest Ctrl-Space

Format document Opt-Shift-F Organise imports Opt-Shift-O

Join lines Ctrl-J

Delete line Cmd-Shift-K

Start new line below Cmd-Enter Start new line above Cmd-Shift-Enter

Move line up/down Opt-Up/Down

Toggle line comment Cmd-/ Toggle block comment Shift-Opt-A

Rename a symbol F2

Insert line below Cmd-Enter Insert line above Cmd-Shift-Enter

Selection

Select word under cursor Cmd-D aka Add Selection To Next Find Match Cursor Undo (reverse last Cmd-D) Cmd-U

Select all occurrences of selection Cmd-Shift-L (useful for renaming something) Select all occurrences of word Cmd-F2

Expand/shrink selection Cmd-Ctrl-Shift-Right/Left

Stretch vertical cursor up/down Cmd-Opt-Up/Down

Navigation

Go back Ctrl-Minus Go forward Ctrl-Shift-Minus

Go to Definition F12 Peek References Shift-F12 Find All References Opt-Shift-F12 (opens a list of references in the sidebar)

Scroll file up/down Ctrl-PageUp/Down aka Ctrl-Fn-Up/Down

Go to line Ctrl-G

Top/bottom of file Cmd-Up/Down (unlike Fn-Cmd-Left/Right in other editors)

Keep current file open Cmd-K Enter or Cmd-S

Focus breadcrumbs Cmd-Shift-. Navigate next/previous in breadcrumbs Ctrl+N / Ctrl+P

Searching

Search in window Cmd-F Search with word under cursor Cmd-E (called Find With Selection) Replace in window Cmd-Opt-F Repeat search Cmd-G

Search in files Cmd-Shift-F Focus next search result F4 Focus previous search result Shift-F4

Replace in files Cmd-Shift-H

Apply the current replacement (one) Cmd-Shift-1 (Cmd-!) Remove the current replacement (one) Cmd-Delete Apply all the replacements Cmd-Opt-Enter

Toggle case sensitive Cmd-Opt-C (inside search) Toggle match whole word Cmd-Opt-W (inside search) Toggle regular expression Cmd-Opt-R (inside search)

Toggle extra search options Cmd-Shift-J

Splitting windows

Split Editor Right Cmd-
Split Editor Down Cmd-K Cmd-
Focus sidebar / split 1 / split 2 Cmd-0 / Cmd-1 / Cmd-2 Split Open from dropdown menu Cmd-
Close All Editors In Group Cmd-K W

Fold code

Unfold All Cmd-K Cmd-J Fold to Level 2 Cmd-K Cmd-2 Fold Cmd-Opt-[ Unfold Cmd-Opt-] Fold recursively Cmd-K [ Unfold recursively Cmd-K ]

(Note when folding, your cursor may need to be outside the area to be folded.)

Advanced

Quick Fix... Cmd-. Auto Fix... Cmd-Opt-.

Show intellisense for focused code Cmd-K Cmd-I

Show details of error under cursor F8

Refactor Ctrl-Shift-R

Specific sidebar Cmd-Shift-E Cmd-Shift-F Cmd-Shift-G Cmd-Shift-D Cmd-Shift-X