10 Typing Shortcuts Every Programmer Should Know
Keyboard shortcuts can make programming more efficient by reducing the amount of time spent moving between the keyboard, mouse, menus, and different parts of your code.
Visual Studio Code includes shortcuts for editing lines, searching files, navigating code, opening commands, commenting code, and performing many other common development tasks.
The shortcuts below are based primarily on the default Windows and Linux VS Code keybindings. If you use macOS, a custom keymap, or another code editor, some shortcuts will be different.
Programmers who also want to become more comfortable and accurate with the keyboard can use Monkeytype to measure their WPM, accuracy, and consistency.

1. Copy and Paste — Ctrl+C and Ctrl+V
These are basic shortcuts, but programmers use them constantly.
Ctrl+C copies selected text.
Ctrl+V pastes copied text.
They are useful when:
- Moving small pieces of code
- Copying configuration values
- Reusing text
- Moving commands between applications
- Working with documentation
However, avoid blindly copying large blocks of code without understanding them. The shortcut saves keystrokes; it does not replace understanding what the code does.
2. Undo and Redo — Ctrl+Z and Ctrl+Y
Mistakes happen constantly while editing code.
Use:
Ctrl+Z — Undo the previous change
Ctrl+Y — Redo an undone change
Undo is particularly useful when you accidentally:
- Delete code
- Replace text incorrectly
- Move a block
- Change formatting
- Paste something in the wrong location
Learning to use undo instinctively can make experimenting with code less frustrating.
3. Find — Ctrl+F
Press Ctrl+F to search within the currently open file.
Instead of manually scrolling through hundreds of lines looking for a variable, function, class, or word, search for it directly.
This is especially useful in larger files.
For example, if you need to find every occurrence of:
calculateTotal
press Ctrl+F and search for that name.
The editor will highlight matching occurrences and let you move between them.
4. Find and Replace — Ctrl+H
When you need to change repeated text, use:
Ctrl+H
This opens Find and Replace.
For example, if you rename:
customerName
to:
clientName
you can locate occurrences and replace them much faster than editing every one manually.
Be careful when performing a large replacement. Check that the search term does not appear somewhere you did not intend to modify.
For code symbols such as variables and functions, your editor’s dedicated rename/refactoring feature can sometimes be safer than simple text replacement.
5. Toggle Line Comment — Ctrl+/
One of the most useful programming shortcuts in VS Code is:
Ctrl+/
It toggles a line comment for the current line or selected lines.
For example:
const total = price * quantity;
can quickly become:
// const total = price * quantity;
Press the shortcut again to remove the comment.
This is useful when:
- Temporarily disabling code
- Testing different logic
- Adding notes
- Debugging
- Commenting several selected lines
The actual comment syntax depends on the programming language you are editing.
6. Indent and Outdent — Tab and Shift+Tab
Proper indentation makes code much easier to read.
With one or more lines selected:
Tab moves the code inward.
Shift+Tab moves it outward.
This is particularly useful when reorganizing:
- Functions
- Loops
- Conditional statements
- HTML
- Nested objects
- Configuration files
Instead of adding or removing spaces from every line manually, select the block and adjust the indentation at once.
7. Delete the Current Line — Ctrl+Shift+K
In VS Code on Windows and Linux, you can delete the current line with:
Ctrl+Shift+K
You do not need to highlight the entire line first.
Place the cursor somewhere on the line and use the shortcut.
This can be much faster than:
- Selecting the line
- Pressing Backspace or Delete
- Cleaning up the remaining blank line
It is especially convenient during refactoring and cleanup.
8. Select the Next Matching Occurrence — Ctrl+D
In VS Code:
Ctrl+D
selects the next occurrence of the current word or selected text.
This is extremely useful for multi-cursor editing.
Suppose your code contains:
const userName = "Ali";
console.log(userName);
return userName;
Select userName and repeatedly press Ctrl+D.
VS Code adds the next matching occurrence to your selection, allowing you to edit several occurrences simultaneously.
This is one of the shortcuts that differs significantly between editors.
In some JetBrains IDEs, Ctrl+D duplicates a line or selection, so always check the shortcuts for the editor you actually use.
9. Jump to a Matching Bracket — Ctrl+Shift+\
Large functions and deeply nested code can make it difficult to see where a block begins or ends.
In VS Code on Windows and Linux, use:
*Ctrl+Shift+*
to jump between matching brackets.
This can help when working with nested:
( )
[ ]
{ }
It is particularly useful for navigating:
- JavaScript functions
- JSON
- Objects
- Arrays
- Conditional blocks
- Loops
Instead of scrolling through a long block of code looking for the closing bracket, the shortcut moves the cursor directly to its match.
10. Open the Command Palette — Ctrl+Shift+P
One of the most powerful shortcuts in Visual Studio Code is:
Ctrl+Shift+P
It opens the Command Palette.
The Command Palette lets you search for VS Code commands without remembering where they appear in menus.
You can use it for tasks such as:
- Changing settings
- Formatting documents
- Opening views
- Running commands
- Working with Git
- Managing extensions
- Changing themes
- Reloading the editor
If you know what you want to do but cannot remember the shortcut, opening the Command Palette and typing the action name is often the fastest solution.
Bonus: Open a File Quickly — Ctrl+P
Another shortcut worth learning is:
Ctrl+P
It lets you quickly search for and open files in your current project.
Instead of navigating through several folders in the Explorer panel, start typing part of the filename.
For developers working in projects containing hundreds of files, this can save a lot of navigation time.
Bonus: Go to a Line — Ctrl+G
Press:
Ctrl+G
to jump directly to a particular line number.
This is useful when:
- An error references a specific line
- Debugging
- Reviewing code
- Following documentation
- Working with compiler messages
For example, if an error tells you to check line 427, Ctrl+G lets you go there immediately instead of scrolling.
Quick VS Code Shortcut Reference
| Action | Windows / Linux Shortcut |
|---|---|
| Copy | Ctrl+C |
| Paste | Ctrl+V |
| Undo | Ctrl+Z |
| Redo | Ctrl+Y |
| Find | Ctrl+F |
| Find and Replace | Ctrl+H |
| Toggle Line Comment | Ctrl+/ |
| Indent | Tab |
| Outdent | Shift+Tab |
| Delete Line | Ctrl+Shift+K |
| Select Next Match | Ctrl+D |
| Matching Bracket | Ctrl+Shift+\ |
| Command Palette | Ctrl+Shift+P |
| Quick Open File | Ctrl+P |
| Go to Line | Ctrl+G |
Remember that shortcuts can differ between operating systems, editors, extensions, and custom keymaps.
Why Keyboard Shortcuts Matter for Programmers
Programming involves much more than simply typing code.
Developers constantly:
- Navigate files
- Search code
- Rename things
- Move between sections
- Select text
- Run commands
- Format code
- Comment and uncomment lines
- Debug problems
Keyboard shortcuts reduce the number of times you need to interrupt that workflow to search through menus.
The goal is not to memorize hundreds of shortcuts.
Learning the handful of commands you use every day usually provides the greatest benefit.
Keyboard Shortcuts vs Typing Speed
Keyboard shortcuts and typing speed improve different parts of your workflow.
Typing speed affects how quickly you can enter text.
Keyboard shortcuts can reduce the number of unnecessary actions required to navigate and edit your work.
A programmer who types extremely quickly but constantly searches menus with a mouse may still work less efficiently than someone with moderate typing speed and excellent editor navigation skills.
Likewise, knowing every VS Code shortcut does not compensate for poor keyboard accuracy.
A useful goal is to develop both:
comfortable typing + efficient editor navigation
If you want to measure your current keyboard performance, try our online typing test and check your WPM, accuracy, and consistency.
Does Faster Typing Make You a Better Programmer?
No.
Programming ability depends much more on skills such as:
- Problem solving
- Understanding programming concepts
- Designing systems
- Debugging
- Reading code
- Communication
- Understanding requirements
Typing faster does not automatically make someone a better developer.
However, becoming comfortable with the keyboard can reduce friction when writing, editing, documenting, and navigating code.
That is why typing skill should be viewed as a productivity skill rather than a measure of programming ability.
If you want to improve your keyboard performance without sacrificing accuracy, read our guide on how to improve your typing speed and accuracy.
How to Learn Keyboard Shortcuts Faster
You do not need to memorize every shortcut at once.
Start With Your Most Frequent Actions
Think about the things you repeatedly do with your mouse.
For example:
- Searching
- Opening files
- Commenting code
- Deleting lines
- Navigating menus
Learn the shortcut for one or two of those actions first.
Learn Gradually
Trying to memorize 50 shortcuts at once usually makes the process harder.
Choose several useful shortcuts and deliberately use them for a few days.
Once they become automatic, add more.
Keep a Small Cheat Sheet
Keep frequently used shortcuts somewhere visible while learning them.
Eventually you will stop needing to look at the list.
Check Your Editor’s Actual Shortcuts
Do not assume shortcuts are identical across every IDE.
VS Code, Visual Studio, IntelliJ IDEA, WebStorm, PyCharm, Sublime Text, and other editors can use different commands.
Even the same editor may use different keybindings on Windows, Linux, and macOS.
Customize When Necessary
VS Code lets you modify keyboard shortcuts.
If a shortcut conflicts with another application or feels uncomfortable, you can change its keybinding.
The best shortcut setup is one you can use consistently.
Typing Practice for Programmers
If you spend many hours programming, you will naturally become familiar with certain keyboard movements.
However, programming text is different from ordinary prose because code frequently contains:
- Parentheses
- Brackets
- Braces
- Underscores
- Numbers
- Punctuation
- Symbols
This means a high score on a simple lowercase-word typing test does not necessarily represent how quickly you can write code.
Still, general typing practice can help develop keyboard familiarity and accuracy.
You can use Monkeytype for regular words and quotes, then enable punctuation and numbers to make your practice more challenging.
Keyboard layout can also affect where symbols and common keys are located. If you’re interested in that topic, read our comparison of QWERTY, Dvorak, and Colemak keyboard layouts.
Frequently Asked Questions
What are the most useful VS Code shortcuts for beginners?
Useful shortcuts to start with include Ctrl+F for Find, Ctrl+H for Replace, Ctrl+/ for comments, Ctrl+P for quickly opening files, and Ctrl+Shift+P for the Command Palette.
What does Ctrl+D do in VS Code?
By default, Ctrl+D selects the next occurrence of the current word or selected text in VS Code. This can be used for editing multiple matching occurrences.
How do I delete a line in VS Code?
On Windows and Linux, Ctrl+Shift+K deletes the current line using the default VS Code keybindings.
How do I comment code in VS Code?
Ctrl+/ toggles line comments for the current line or selected lines using the default Windows and Linux VS Code keybindings.
How do I open the VS Code Command Palette?
Press Ctrl+Shift+P on Windows or Linux to open the Command Palette.
Are VS Code shortcuts the same on Mac?
No. Many shortcuts use different keys on macOS. VS Code also allows users to customize shortcuts and install different keymaps.
Are keyboard shortcuts the same in every IDE?
No. Shortcut combinations can differ significantly between VS Code, JetBrains IDEs, Visual Studio, and other editors. Always check the keyboard-shortcut reference for the editor you use.
Final Thoughts
You do not need to memorize every Visual Studio Code shortcut to become more efficient.
Start with the actions you perform repeatedly, such as searching files, commenting code, opening commands, deleting lines, and navigating your project.
Once those shortcuts become automatic, gradually add more.
Keyboard shortcuts will not make you a better programmer by themselves, but they can remove small interruptions from your workflow and make working with code feel smoother.
And if you want to work on the typing side of keyboard efficiency as well, test your typing speed and use your WPM, accuracy, and consistency as a baseline for improvement.
