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.
Therefore, learning simple keyboard shortcuts for Visual Studio Code app can help you to improve your productivity.
VSC Mac Shortcut | What it does? |
---|---|
Command + C | Copy the selected line into clipboard |
Command + X | Cut the selected line into clipboard |
Command + Enter | Create a new line (similar to pressing enter key) |
Commnd + / | Comment or uncomment the current line where the cursor is positioned |
Fn + Up Arrow | Go to one page up |
Fn + Down Arrow | Go to one page down |
Command + Up Arrow | Take you to start of the file |
Command + down Arrow | Take you to end of the file |
Command + ] | Indent the content of a line |
Command + [ | Outdent the content of a line |
Command + Shift + K | Delete the current line |
Command + Shift + Enter | Insert a line above the current line |
Command + Shift + \ | Move to corresponding matching bracket |
Option + Shift + A | Insert a block comment, you can toggle inserting and deleting by pressing the same shortcut keys |
Option + Z | Enable or disable word wrap |
Command + Option + [ | Fold the current matching tags |
Command + Option + ] | Open or unfold the current matching tags |
Option + Up Arrow | Move the content of current line up |
Option + Down Arrow | Move the content of current line down |
Command + B | Toggle sidebar on or off |
Command + = | Zoom in the window |
Command + – | Zoom out the window |
Command + Shift + D | View and run debug |
Command + Shift + E | Show explorer sidebar |
Command + Shift + F | Show search box |
Command + Shift + H | Show search and replace option |
Command + Shift + J | Toggle files to include / exclude in search |
Command + Shift + U | Toggle output panel |
Command + Shift + X | Show extensions marketplace |
Command + Control + F | Toggle full screen mode on or off |
Control + Shift + G | View source coontrol |
Command + 1 to 9 | Open and focus the corresponding editor section |
Command + 0 | Open and focus on the sidebar control |
Command + W | Close current file editor |
Command + Shift + W | Close current instance of window |
Command + \ | Split editor, press repeatedly to continue creating new split editor area |
Command + N | Open new empty file |
Command + O | Browser and open file from your computer |
Command + S | Save current file |
Command + Shift + S | Save as a file |
Command + Shift + T | Reopen previously close editor window |
Control + Tab | Toggle across editor windows to move next |
Command + Option + S | Save all files open in editors |
Control + Shift + Tab | Toggle across editor windows to move previous |
Command + K | Enable keyboard shortcut sequence |
Command + P | Go to a file by searching the name |
Command + , | Open settings section |
Command + Shift + N | Open new instance of Visual Studio Code editor in new window |
Command + Shift + P | Open complete command list (Command Palette) |
Command + V | Paste copied content |
Command + U | Move to previous cursor position |
Command + Shift + L | Select all occurances of selected content, you can cut to remove all occurance at once |
Command + Shift + M | Toggle Problems panel |
Control + G | Go to an entered line |
Control + – | Move in backward direction |
Control + Shift + – | Move in forward direction |
Command + F | Open Find box |
Command + G | Find the next instance of the selection |
Command + Shift + G | Find the previous instance of the selection |
Command + Option + F | Open Find and Replace box |
Control + ` | Open Terminal panel |
Control + Shift + ` | Open new Terminal panel |
Command + Control + Shift + Right Arrow | Expand selection |
Command + Control + Shift + Right Arrow | Shrink selection |
Command + Shift + Y | Open debug console |
Option + Shift + Up Arrow | Copy the current line and insert above |
Option + Shift + Down Arrow | Copy the current line and insert below |
Command + Control + Up Arrow | Insert cursor in above line |
Command + Control + Down Arrow | Insert cursor in below line |
Command + Z | Undo previous action |
Command + Shift + Z | Redo previous action |
Fn Fn | Start dictation |
Command + Control + Shift | Open Character Viewer app to insert emoji & symbols |
Command + H | Hide Visual Studio Code app |
Command + Option + H | Hide all other apps |
Command + Q | Quit 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 Reply
Your email is safe with us.