Visible Studio Code (VS Code) is a free, open-source code editor launched by Microsoft. As a consequence of its light-weight design, highly effective options, and intensive customization choices, VS Code shortly grew to become the preferred code editor amongst builders. VS Code additionally has a wealthy assortment of extensions, assist for a variety of programming languages, IntelliSense code completion, debugging capabilities, and built-in Git management.
Please notice that these shortcuts are taken from VS Code’s documentation. If some shortcuts don’t work, it might be as a consequence of adjustments in shortcuts in your editor or file format or generally as a consequence of extensions put in.
Key Takeaways
Mastering VS Code can considerably improve your developer expertise. This text discusses the best way to use VS Code keyboard shortcuts to simply navigate, edit, and handle your code base.
- Fast Navigation: Use Ctrl + P (Home windows/Linux) or Command + P (macOS) to immediately discover and open information, streamlining your workflow.
- Entry Settings: Customise your VS Code settings simply with Ctrl + , (Home windows/Linux) or Command + , (macOS).
- Environment friendly Modifying: Choose all occurrences of a phrase or phrase with Ctrl + Shift + L (Home windows/Linux) or Command + Shift + L (macOS) for fast world edits.
- Duplicate Traces: Rapidly duplicate strains of code utilizing Shift + Alt + ↓ (Home windows/Linux) or Shift + Possibility + ↓ (macOS).
- Built-in Terminal: Toggle the terminal inside the editor utilizing Ctrl + J (Home windows/Linux) or Command + J (macOS) to streamline command-line duties.
- Command Palette: Entry the command palette with Ctrl + Shift + P (Home windows/Linux) or Command + Shift + P (macOS) for fast command execution.
- Go to Definition: Soar to definitions of variables, features, and courses with F12, enhancing code navigation.
- Customized Shortcuts: Personalize your workflow by customizing shortcuts with Ctrl + Okay, Ctrl + S (Home windows/Linux) or Command + Okay, Command + S (macOS).
- Format Code: Use Ctrl + Shift + F (Home windows/Linux) or Possibility + Shift + F (macOS) to format your code for higher readability.
- Rename Symbols: Safely rename variables, features, and courses throughout your codebase with F2.
Simple VS Code Navigation Shortcuts
This part presents all of the Visible Studio Code shortcuts that permit you to navigate completely different components of the editor. In case you are new to VS Code, comply with this information to get a complete understanding.
1. Open a File
When your initiatives develop, navigating by the file explorer to discover a particular file will be tough. So, it’s undoubtedly useful to be taught this keyboard shortcut to open information simply in your undertaking.
- Home windows/Linux: Ctrl + P
- macOS: Command + P

2. Fast Change Between Recordsdata
This VS Code hotkey lets you shortly cycle by their just lately opened information.
- Home windows/Linux: Ctrl + Tab
- macOS: Command + Tab

3. Open Settings
Visible Studio Code comes with many options and customizing choices to suit your wants. This keyboard shortcut makes it simpler to open these settings every time vital.
- Home windows/Linux: Ctrl + ,
- macOS: Command + ,

You typically want more room for the open information you’re engaged on. So, this keyboard shortcut is useful to point out or conceal the sidebar every time vital.
- Home windows/Linux: Ctrl + B
- macOS: Command + B
5. Navigate Tabs
This VS Code swap tab shortcut is fairly helpful when you have got many tabs open and want to maneuver between them. It reveals you an inventory of the opened tabs, permitting you to change tabs and choose which one to open.
- Home windows/Linux: Ctrl + Shift + Tab
- macOS: Management + Shift + Tab

6. Navigate Tab Teams
As builders, all of us face conditions the place we have to open and replace a number of information directly. Nicely, VS Code has the proper answer for that. VS Code lets you create a break up editor by grouping your tabs into teams, and every editor group takes up a part of the display.
This keyboard shortcut makes navigating between teams within the break up editor simpler and quicker. It additionally lets you create a brand new group if the editor group you choose within the shortcut is larger than the variety of teams at the moment open.
- Home windows/Linux: Ctrl + 1 or 2 or 3
- macOS: Command + 1 or 2 or 3

7. Open the Terminal
Throughout your improvement, you’ll almost certainly be utilizing the terminal so much. Visible Studio Code permits you to open a terminal window contained in the editor. This protects you from transferring between the editor and the terminal and allows you to focus utterly on the editor and the code.
- Home windows/Linux: Ctrl + J
- macOS: Command + J
8. Cut up Terminal
You should utilize this VSCode hotkey to separate the VS Code terminal. This allows you to carry out a number of terminal duties, comparable to utility execution and log monitoring, with out switching between terminal home windows.
- Home windows/Linux: Ctrl + Shift + 5
- macOS: Command +

9. Open the Command Palette
With this VS Code hotkey, you may simply open the command palette. The command palette lets you search by the instructions you should use and execute them.
- Home windows/Linux: Ctrl + Shift + P
- macOS: Command + Shift + P
Fast Alternatives
Throughout improvement, you’ll likely have to make alternatives in your code, whether or not for copying, reducing, or different functions.
As an alternative of doing so together with your machine’s mouse, doing it with the keyboard saves you time. These VS Code hotkeys give attention to making alternatives shortly.
10. Choose Present Line
Numerous instances, you’ll want to choose the whole present line your cursor is at. This keyboard shortcut makes it quite simple.
- Home windows/Linux: Ctrl + L
- macOS: Command + L

Comparable Occurrences
We frequently face conditions the place we have to rename a variable or just change a sure repeated textual content or phrase all through the present file. These 2 VSCode hotkeys can be utilized in an identical state of affairs. The primary requires you to have already got the phrase or phrases chosen, whereas the opposite doesn’t.
11. Present Choice
With this keyboard shortcut, you solely want to pick one prevalence of the textual content you’re on the lookout for. Then, by urgent the keys of the shortcut, you’ll choose all its occurrences within the present file.
- Home windows/Linux: Ctrl + Shift + L
- macOS: Command + Shift + L

12. Present Phrase
This keyboard shortcut lets you do the identical because the earlier one however with out having something chosen. You solely want to position the cursor on the phrase and press the shortcut keys.
- Home windows/Linux: Ctrl + F2
- macOS: Command + F2
Be aware: On macOS, press fn similtaneously F2.
13. Choose Till the Finish of the Phrase
When choosing a sure a part of the code, you may simply transfer and develop the choice with this shortcut. You should utilize the best or left arrows to go within the course you need.
- Home windows/Linux: Shift + Alt + → or ←
- macOS: Shift + Possibility + → or ←
14. Duplicate Code
ctrl + c and ctrl + v is the common keyboard shortcut to repeat and paste. Nevertheless, Visible Studio Code has a keyboard shortcut to duplicate code with only a single key.
You should utilize this keyboard shortcut to duplicate a specific line. You simply have to hold the cursor within the line you’ll want to duplicate.
- Home windows/Linux: Shift + Alt + ↓
- macOS: Shift + Possibility + ↓

A number of Alternatives
These visible studio code ideas will assist you choose throughout a number of strains to make vital modifications or additions. This protects you from repeating your self and saves you the extra time you’d spend doing the identical operation throughout a number of strains.
15. Choose a Column or Field of Code by Dragging the Mouse
This keyboard shortcut lets you choose a number of strains directly.
- Home windows/Linux: Shift + Alt + drag mouse throughout the strains
- macOS: Shift + Possibility + drag mouse throughout the strains

16. Choose a Column or Field of Code with Arrow Keys
You are able to do the identical as above, however with out utilizing your mouse. As an alternative of dragging a mouse, you utilize the keyboard arrow keys.
- Home windows/Linux: Ctrl + Shift + Alt + → or ← or ↓ or ↑
- macOS: Command + Shift + Possibility + → or ← or ↓ or ↑
Find out how to Use Discover Outcomes
Search performance is a basic characteristic in all code editors. Even the best editors permit you to search with sure phrases, like operate or variable names, phrases, or blocks of code, both within the at the moment chosen file or throughout a number of information. Listed below are the keyboard shortcuts to simplify looking with VS Code.

17. Navigate Outcomes
You should utilize this keyboard shortcut to maneuver between discover leads to the energetic file.
Be aware: On macOS, press fn similtaneously F3.
18. Choose A number of Outcomes
You should utilize this shortcut to navigate by and choose a number of occurrences of the search outcomes inside the energetic file.
- Home windows/Linux: Ctrl + D
- macOS: Command + D
19. Choose All Outcomes
When you’re utilizing the discover characteristic to make sure modifications to all of the discover outcomes, this keyboard shortcut lets you choose all of the discover outcomes.
- Home windows/Linux: Alt + Enter
- macOS: Possibility + Enter
Code Navigation
As every file or undertaking grows, it turns into more durable to search out sure components of the code. Discovering errors or going to the code at a sure line will be arduous when doing it manually.
These visible studio code ideas will prevent the trouble and permit you to make investments your time in what you really wish to do.
20. Go to Line
Discovering code at a sure line is particularly useful once you get a compile or runtime error that specifies what line of code induced it. This keyboard shortcut eliminates the necessity to really discover the road your self.
- Home windows/Linux: Ctrl + G
- macOS: Management + G

21. Go to Matching Bracket
You’ll typically end up needing to search out the matching closing bracket of a block. That is very true when the information develop with time. This keyboard shortcut lets you simply discover the closing matching bracket of the present block. HTML tags permit you to transfer to the tip of the present tag.
- Home windows/Linux: Ctrl + Shift +
- macOS: Command + Shift +
22. Fold/Unfold Block
When studying a file with loads of strains or information, it’s simpler to fold (conceal) a complete block that you just’re not at the moment specializing in so you may give attention to one thing else. This keyboard shortcut lets you fold or unfold a block. Click on anyplace within the block after which hit the next keys.
- Home windows/Linux: Ctrl + Shift + [ or ]
- macOS: Command + Possibility + [ or ]

23. Fold/Unfold Blocks and Sub-Blocks
What if the block accommodates sub-blocks? Utilizing the above command will fold the mum or dad, however when the mum or dad is unfolded, the sub-blocks will stay unchanged. If you’ll want to fold and unfold a block and its sub-blocks, you are able to do it with this keyboard shortcut.
- Home windows/Linux: Ctrl + Okay + [or ]
- macOS: Command + Okay + [ or ]
24. Navigate Errors and Warnings
Discovering errors and warnings in your code is crucial. Typically, some errors will not be simple to search out — comparable to when a line doesn’t finish because it ought to. This keyboard shortcut saves you the trouble of scrolling or totally wanting by the road to search out the precise drawback. It lets you transfer to the subsequent error or warning.
Be aware: On macOS, press fn similtaneously F8.
Transferring the Cursor
In loads of circumstances, you would possibly have to have a number of cursors, every at a special place within the file. These keyboard shortcuts assist to make it simpler to maneuver round with a number of cursors.
Insert Extra Cursors
There are two methods to insert a further cursor into the file: both at a selected place or above/beneath the present line the cursor is at.
25. At Place
This keyboard shortcut lets you insert a further cursor at any level within the file.
- Home windows/Linux: Alt + mouse click on on the place
- macOS: Possibility + mouse click on on the place

26. Above or Under
The second manner you may insert a cursor is to insert it above or beneath every of the present cursor positions.
- Home windows/Linux: Ctrl + Alt + ↓ or ↑
- macOS: Command + Possibility + ↓ or ↑

27. Undo Cursor Insert
This keyboard shortcut lets you undo the final cursor insert. That is very useful once you’ve inserted a number of cursors, because it lets you hold the others in place and simply removes the final inserted one.
- Home windows/Linux: Ctrl + U
- macOS: Command + U
28. Insert the Cursor on the Finish of a Highlighted Choice
One other keyboard shortcut that makes your improvement quicker is to insert the cursor on the finish of a highlighted choice.
- Home windows/Linux: Shift + Alt + I
- macOS: Shift + Possibility + I
Sooner Coding
On this part, we’ll undergo VS Code shortcuts that can make sure operations associated to your code simpler and faster.
29. Transfer Traces and Blocks
Numerous instances, you would possibly want to maneuver a line from one place to a different. As an alternative of copying or reducing and pasting the road into one other place, this shortcut provides a quicker answer. Simply place the cursor on the road.
- Home windows/Linux: Alt + ↓ or ↑
- macOS: Possibility + ↓ or ↑

This will even transfer an entire paragraph of textual content that the cursor is energetic in. If you wish to transfer a block of code, merely spotlight that code earlier than urgent the shortcut above.
30. Indent/Outdent Traces
As you copy strains from one place or file to a different, or as you make adjustments to the code, the code will typically find yourself wrongly indented. This shortcut lets you simply indent or outdent strains as vital. Choose a number of strains to maneuver all of them collectively.
- Home windows/Linux: Ctrl + [ or ]
- macOS: Command + [ or ]
In loads of circumstances, you would possibly have to remark or uncomment a line. This may be simply carried out with this shortcut. This works for each line and block feedback.
Click on on the road you wish to remark out. (When you spotlight a code block, this command will remark out every line individually.)
In contrast to the above shortcut, the next shortcut will remark out the code you spotlight as a single remark.
- Home windows/Linux: Shift + Alt + A
- macOS: Shift + Possibility + A

33. File Formatting
This shortcut lets you format paperwork totally.
- Home windows/Linux: Ctrl + Shift + F
- macOS: Possibility + Shift + F
34. Choice Formatting
This shortcut lets you format simply the chosen set of strains in a file.
- Home windows/Linux: Ctrl + Okay, then Ctrl + F
- macOS: Command + Okay, then Command + F

35. Fast Repair
In loads of circumstances when there’s an error, VS Code can resolve it if it’s a standard or easy mistake. For instance, if a semicolon is lacking. This shortcut lets you apply the short repair to any error or warning if the short repair is accessible for it.
- Home windows/Linux: Ctrl + .
- macOS: Command + .
36. Renaming
Renaming a variable, operate, or class that’s used a number of instances will be susceptible to errors if carried out manually. You would possibly miss a utilization of it within the present or a special file. This shortcut offers you a secure strategy to rename any image.
Be aware: On macOS, press fn similtaneously F2.
37. Trim White Areas
Why manually trim white areas from the tip of a line when you may simply do it with this shortcut?
- Home windows/Linux: Ctrl + Okay , then X individually.
- macOS: Command + Okay , then X individually.
38. Change Programming Language
By default, Visible Studio Code detects the present programming language of the file you’re engaged on. Often, it’s carried out by checking the extension of the file.
Nevertheless, generally it doesn’t appropriately detect the language if the file extension isn’t supported. So, if you’ll want to change the programming language of a file, you should use this shortcut.
- Home windows/Linux: Ctrl + Okay, then M
- macOS: Command + Okay, then M

39. Run Code
One cool VS Code characteristic is the choice to run code proper within the editor. This relies on the language, framework, or the form of activity you’ll want to run. For instance, you may arrange debugging for Javascript initiatives. Nevertheless, when you’ve got a debugger or activity runner configured, you should use this shortcut to run code in Visible Studio Code.
Be aware: On macOS, press fn similtaneously F5.
Higher Coding
Understanding your code is the important thing to sustaining a high-quality code base. Usually, we resort to googling a operate to see its definition or signature. Nevertheless, this would possibly find yourself losing our time, or it won’t apply to the code we’ve created.
Because of this, VS Code has launched a set of shortcuts that can assist you produce higher code.
40. Go to Definition
This shortcut takes us to the file or line the place the a part of the code is initially outlined.
- Home windows/Linux/macOS: F12
Be aware: On macOS, press fn similtaneously F12.
41. Peek Definition
This shortcut permits us to open definitions and documentation in the identical place we’re checking the definition. This makes it simpler to see the definition with out transferring to a different file or line.
- Home windows/Linux: Alt + F12
- macOS: Possibility + F12
Be aware: On macOS, press fn similtaneously F12.
42. Toggle Recommendations
We frequently use VS Code or different extensions like GitHub Copilot to get code ideas. This shortcut permits us to toggle the ideas to see or conceal them.
- Home windows/Linux: Ctrl + I
- macOS: Command + I
43. Present a Operate’s Signature
This is quite common with most, if not all, builders. We are inclined to overlook features’ signatures, even after they’re features that we use so much. With this shortcut, you may simply see parameter hints for the operate. With the parameter hints, you may verify what parameters you’ll want to move to the operate.
- Home windows/Linux: Ctrl + Shift + Spacebar
- macOS: Command + Shift + Spacebar
44. Zen Mode
Though that is unrelated to understanding the code and definitions, this shortcut is beneficial for those who should be utterly centered in your code. With this shortcut, you may allow Zen mode, which is able to change the show to be utterly centered on the at the moment open file.
- Home windows/Linux: Ctrl + Okay, then Z
- macOS: Command + Okay, then Z

Press the identical keyboard shortcut to return to the conventional editor view.
45. Shut All Editors
In case you are carried out with improvement or really feel too many information are open, you may shut them suddenly utilizing the shortcut beneath.
- Home windows/Linux: Ctrl + Okay + W
- macOS:
Command+Okay+W
Conclusion
VS Code is likely one of the finest code/textual content editors for builders in the mean time. It supplies loads of out-of-the-box options in addition to an extension market that enables builders to simply contribute and supply extensions for the group.
Keyboard shortcuts make improvement in VS Code even simpler and permit you to give attention to constructing good-quality initiatives in much less time.
On this article, we’ve coated some helpful Visible Studio Code shortcuts which might be assured to make your improvement quicker. Aside from what we mentioned, VS Code comes with many extra shortcuts for fast actions. Listed below are hyperlinks for testing the entire set of default keyboard shortcuts in your OS:
FAQs About VS Code Shortcuts
How do I see all shortcuts in VS Code?
In VS Code, you may entry the Keyboard Shortcuts view by urgent:
- Home windows/Linux: Ctrl + Okay adopted by Ctrl + S
- macOS: Command + Okay adopted by Command + S
Alternatively, you may click on the gear icon (⚙️) within the backside left nook of the VS Code window and choose “Keyboard Shortcuts.” This view shows an inventory of all default shortcuts, and you’ll seek for particular instructions, filter by classes, and even customise or reset shortcuts to your preferences.
What does Ctrl P do in VS Code?
In VS Code, urgent Ctrl + P (or Command + P on macOS) opens the “Fast Open” characteristic. This characteristic lets you shortly seek for and open information, in addition to navigate to symbols and different objects inside your undertaking.
Once you press Ctrl + P, a small enter field seems on the high of the editor. You can begin typing the identify of the file or merchandise you wish to open or navigate to. As you sort, VS Code will show matching leads to real-time. You should utilize the arrow keys to pick from the record of outcomes after which press Enter to open the chosen file or merchandise.
What does Ctrl Shift L do in VS Code?
In VS Code, urgent Ctrl + Shift + L (or Command + Shift + L on macOS) is a keyboard shortcut used to pick all occurrences of the at the moment chosen phrase or textual content inside the energetic file. This characteristic known as “Choose All Occurrences.”
This may be notably useful once you wish to shortly discover and edit all cases of a variable, operate, or another textual content inside a file. It permits for environment friendly and constant adjustments throughout a number of occurrences with out manually choosing every one.
What does F12 do in VS Code?
In VS Code, urgent the F12 secret is a keyboard shortcut used to set off the “Go to Definition” motion. Once you place your cursor on a variable, operate, class, or methodology and press F12, VS Code will navigate you to the situation the place that image is outlined or declared.
This characteristic is extremely helpful for shortly understanding code, exploring libraries or frameworks, and navigating massive codebases. It lets you bounce to the definition of an emblem with out manually looking by your undertaking’s information.
What does Ctrl Shift P do in VS Code?
In VS Code, urgent Ctrl + Shift + P (or Command + Shift + P on macOS) opens the “Command Palette.” The Command Palette is a strong characteristic that lets you seek for and execute numerous instructions and actions inside VS Code.
The Command Palette is a fast and environment friendly strategy to entry and execute numerous options, settings, and extensions inside VS Code with out having to memorize all of the out there shortcuts. You should utilize it to open information, swap between open information, configure settings, set up extensions, and carry out many different duties.
How can I customise keyboard shortcuts in VS Code?
To customise keyboard shortcuts in VS Code, comply with these steps:
- Press Ctrl + Okay adopted by Ctrl + S on Home windows/Linux or Command + Okay adopted by Command + S on macOS to open the Keyboard Shortcuts view.
- There, you may seek for the command you wish to customise.
- As soon as you discover the command, right-click on it and choose “Change Keybinding” or click on on the pencil icon subsequent to the command.
- Enter the brand new key mixture you wish to assign to the command and press Enter.
You may as well edit the keybindings.json file instantly for extra superior customization. This file will be accessed by clicking on the hyperlink keybindings.json on the high proper nook of the Keyboard Shortcuts view. Right here, you may manually add, take away, or modify keybindings utilizing JSON format.


