Home » Tech Tips » Shortcuts » Keyboard Shortcuts for Visual Studio Code Editor in Mac

Keyboard Shortcuts for Visual Studio Code Editor in Mac

Apple supplies TextEdit app as a default text editor in MacBook. Unlike Notepad app in Windows, you can use TextEdit app to process both plain as well as rich text content. For example, you can bold the text in TextEdit app while you can’t do that with Notepad in Windows. However, editing source code like HTML, CSS, JavaScript or PHP needs much more features than plain or rich text processing. You need the syntax to be highlighted in different colors and show the opening / closing tags properly. Visual Studio Code (VSC) is the most popular code editor from Microsoft that you can use in Mac. Here is a complete list of keyboard shortcuts for Visual Studio Code editor in Mac to get things done quickly.

Keyboard Shortcuts for Visual Studio Code Editor in Mac

When using code editors like VSC, you may need to carry out certain activities frequently. For example, you may need to move a line or code block to different section in your document. It will be a tedious and error prone task to cut the code, scroll to the required place and then paste it. The best option is to use option key with up or down arrow keys and move the selected code to the required position up or down. Remember, you can move the code by navigating to “Selection > Move Line Up or Down” menus. However, it will be supper annoying to use the menu each time when you have to move the code hundreds of lines away from the current line.

Similarly, going to “Edit > Replace in Files” will open search function in the sidebar. This may be useful for finding and replacing a string in multiple files. However, you can open find and replace function within a file using “Command + Option + F” keyboard shortcuts.

Find and Replace in Visual Studio Code Editor
Find and Replace in Visual Studio Code Editor

Therefore, learning simple keyboard shortcuts for Visual Studio Code app can help you to improve your productivity.

VSC Mac ShortcutWhat it does?
Command + CCopy the selected line into clipboard
Command + XCut the selected line into clipboard
Command + EnterCreate a new line (similar to pressing enter key)
Commnd + /Comment or uncomment the current line where the cursor is positioned
Fn + Up ArrowGo to one page up
Fn + Down ArrowGo to one page down
Command + Up ArrowTake you to start of the file
Command + down ArrowTake you to end of the file
Command + ]Indent the content of a line
Command + [Outdent the content of a line
Command + Shift + KDelete the current line
Command + Shift + EnterInsert a line above the current line
Command + Shift + \Move to corresponding matching bracket
Option + Shift + AInsert a block comment, you can toggle inserting and deleting by pressing the same shortcut keys
Option + ZEnable or disable word wrap
Command + Option + [Fold the current matching tags
Command + Option + ]Open or unfold the current matching tags
Option + Up ArrowMove the content of current line up
Option + Down ArrowMove the content of current line down 
Command + BToggle sidebar on or off
Command + =Zoom in the window
Command + –Zoom out the window
Command + Shift + DView and run debug
Command + Shift + EShow explorer sidebar
Command + Shift + FShow search box
Command + Shift + HShow search and replace option
Command + Shift + JToggle files to include / exclude in search 
Command + Shift + UToggle output panel
Command + Shift + XShow extensions marketplace
Command + Control + FToggle full screen mode on or off
Control + Shift + GView source coontrol
Command + 1 to 9Open and focus the corresponding editor section
Command + 0Open and focus on the sidebar control
Command + WClose current file editor
Command + Shift + WClose current instance of window
Command + \Split editor, press repeatedly to continue creating new split editor area
Command + NOpen new empty file
Command + OBrowser and open file from your computer
Command + SSave current file
Command + Shift + SSave as a file
Command + Shift + TReopen previously close editor window
Control + TabToggle across editor windows to move next
Command + Option + SSave all files open in editors
Control + Shift + TabToggle across editor windows to move previous
Command + KEnable keyboard shortcut sequence
Command + PGo to a file by searching the name
Command + ,Open settings section
Command + Shift + NOpen new instance of Visual Studio Code editor in new window
Command + Shift + POpen complete command list (Command Palette)
Command + VPaste copied content
Command + UMove to previous cursor position
Command + Shift + LSelect all occurances of selected content, you can cut to remove all occurance at once
Command + Shift + MToggle Problems panel
Control + GGo to an entered line
Control + –Move in backward direction
Control + Shift + –Move in forward direction
Command + FOpen Find box
Command + GFind the next instance of the selection
Command + Shift + GFind the previous instance of the selection
Command + Option + FOpen Find and Replace box
Control + `Open Terminal panel
Control + Shift + `Open new Terminal panel
Command + Control + Shift + Right ArrowExpand selection
Command + Control + Shift + Right ArrowShrink selection
Command + Shift + YOpen debug console
Option + Shift + Up ArrowCopy the current line and insert above
Option + Shift + Down ArrowCopy the current line and insert below
Command + Control + Up ArrowInsert cursor in above line
Command + Control + Down ArrowInsert cursor in below line
Command + ZUndo previous action
Command + Shift + ZRedo previous action
Fn FnStart dictation
Command + Control + Shift Open Character Viewer app to insert emoji & symbols
Command + HHide Visual Studio Code app
Command + Option + HHide all other apps
Command + QQuit Visual Studio Code app

Keyboard Shortcuts in PDF

Microsoft also offers a keyboard shortcuts document in PDF format for VSC Mac version. You can go to “Help > Keyboard Shortcuts Reference” menu or press “Command + K” and then “Command + R” shortcut keys. This will open the Visual Studio Code website in your default browser showing the PDF file. You can download or print the file for offline use. Alternatively, click on the below download button to get the VSC keyboard shortcuts for Mac in PDF format.

Leave a Comment

Your email address will not be published. Required fields are marked *