=========================================== Visual Studio Code (Mac) keyboard shortcuts =========================================== First published at 12/30/2017 on https://defkey.com/visual-studio-code-mac-shortcuts Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It has features such as debugging, Git control, syntax highlighting, smart code completion, snippets and refactoring. It's free and open-source, however official download is under a proprietary license. Visual Studio Code (Mac) has 131 shortcuts and we have listed all of them below. General ------- Shift + Cmd + P then F1 Show Command Palette Cmd + P Quick Open, Go to File Shift + Cmd + N New window/instance Cmd + W Close window/instance Cmd + , User Settings Cmd + K then Cmd + S Keyboard Shortcuts Basic editing ------------- Cmd + X Cut line (empty selection) Cmd + C Copy line (empty selection) Option + Up arrow / Down arrow Move line up/down Shift + Option + Up arrow / Down arrow Copy line up / down Cmd + Enter Insert line below Shift + Cmd + Enter Insert line above Shift + Cmd + \ Jump to matching bracket Cmd + ] Indent/outdent line Cmd + [ Indent/outdent line Home Go to beginning of line End Go to end of line Cmd + Up arrow Go to beginning of file Cmd + Down arrow Go to end of file Ctrl + Up arrow / Down arrow Scroll line up/down Control + Page Up Scroll page up Control + Page Down Scroll page down Option + Cmd + [ Fold (collapse) region Option + Cmd + ] Unfold (uncollapse) region Cmd + K then Cmd + [ Fold (collapse) all subregions Cmd + K then Cmd + ] Unfold (uncollapse) all subregions Cmd + K then Cmd + 0 Fold (collapse) all regions Cmd + K then Cmd + J Unfold (uncollapse) all regions Cmd + K then Cmd + C Add line comment Cmd + K then Cmd + U Remove line comment Cmd + / Toggle line comment Shift + Option + A Toggle block comment Option + Z Toggle word wrap Navigation ---------- Cmd + T Show all symbols Control + G Go to line Cmd + P Go to file Shift + Cmd + O Go to symbol Shift + Cmd + M Show Problems panel F8 Go to next error or warning Shift + F8 Go to previous error or warning Ctrl + Shift + Tab Navigate editor group history Ctrl + - Go back Ctrl + Shift + - Go forward Ctrl + Shift + M Toggle Tab moves focus Search and replace ------------------ Cmd + F Find Option + Cmd + F Replace Cmd + G Find next Shift + Cmd + G Find previous Option + Enter Select all occurences of Find match Cmd + D Add selection to next Find match Cmd + K then Cmd + D Move last selection to next Find match Multi-cursor and selection -------------------------- Option + Left click Insert cursor Option + Cmd + Up arrow / Down arrow Insert cursor above / below Cmd + U Undo last cursor operation Shift + Option + I Insert cursor at end of each line selected Cmd + I Select current line Shift + Cmd + L Select all occurrences of current selection Cmd + F2 Select all occurrences of current word Ctrl + Shift + Cmd + Right arrow Expand selection Ctrl + Shift + Cmd + Left arrow Shrink selection Shift + Option + Move the mouse Column (box) selection Shift + Option + Cmd + Left arrow / Right arrow Column (box) selection left/right Shift + Option + Command + Page Up Column (box) selection page up Shift + Option + Command + Page Down Column (box) selection page down Rich languages editing ---------------------- Ctrl + Space Trigger suggestion Shift + Cmd + Space Trigger parameter hints Shift + Option + F Format document Cmd + K then Cmd + F Format selection F12 Go to Definition Option + F12 Peek Definition Cmd + K then F12 12 Open Definition to the side Cmd + . Quick Fix Shift + F12 Show References F2 Rename Symbol Cmd + K then Cmd + X Trim trailing whitespace Cmd + K then M M Change file language Editor management ----------------- Cmd + W Close editor Cmd + K then F F Close folder Cmd + \ Split editor Cmd + 1 Focus into first group Cmd + 2 Focus into second group Cmd + 3 Focus into third group Cmd + K then Cmd + Left arrow / Right arrow Focus into previous/next editor group Cmd + K then Shift + Cmd + Left arrow Move editor left Cmd + K then Shift + Cmd + Right arrow Move editor right Cmd + K then Left arrow / Right arrow Move active editor group File management --------------- Cmd + N New File Cmd + O Open File Cmd + S Save Shift + Cmd + S Save As Option + Cmd + S Save All Cmd + W Close Cmd + K then Cmd + W Close All Ctrl + Shift + T Reopen closed editor Cmd + K then Enter Keep preview mode editor open Control + Tab Open next Control + Shift + Tab Open previous Cmd + K then P Copy path of active file Cmd + K then R Reveal active file in Explorer Cmd + K then O Show active file in new window/instance Display ------- Control + Cmd + F Toggle full screen Option + Cmd + 1 Toggle editor layout (horizontal/vertical) Cmd + = Zoom in Shift + Cmd + - Zoom out Cmd + B Toggle Sidebar visibility Shift + Cmd + E Show Explorer / Toggle focus Shift + Cmd + F Show Search Control + Shift + G Show Source Control Shift + Cmd + D Show Debug Shift + Cmd + X Show Extensions Shift + Cmd + H Replace in files Shift + Cmd + J Toggle Search details Shift + Cmd + U Show Output panel Shift + Cmd + V Open Markdown preview Cmd + K then V Open Markdown preview to the side Cmd + K then Z Zen Mode (Esc Esc to exit) Debug ----- F9 Toggle breakpoint F5 Start/Continue Shift + F5 Stop F11 Step into Shift + F11 Step out F10 Step over Cmd + K then Cmd + I Show hover Integrated terminal ------------------- Control + ` Show integrated terminal Control + Shift + ` Create new terminal Cmd + C Copy selection Cmd + Up arrow / Down arrow Scroll up/down Page Up Scroll page up Page Down Scroll page down Cmd + Home Scroll to top Cmd + End Scroll to bottom Last modified on (UTC): Saturday, January 16, 2021 Defkey © All rights reserved.