VS Code Shortcuts Every Developer Should Know

작성자

카테고리:

← 피드로
DEV Community · Chris Ebube Roland · 2026-07-22 개발(SW)

Hey devs!

If you’re still clicking through menus and dragging lines of code around in VS Code, you’re wasting time you don’t even realize you’re losing.

I’m not going to dump a bunch of shortcuts on you that you’ll forget by tomorrow. These are the ones I actually use every day. Learn these and your editing speed will genuinely change.

I’m on a Mac, but I’ve included the Windows/Linux keys for everything too.

Let’s get into it.

1. Move lines up and down

Mac: Option + ↑ / ↓ | Windows/Linux: Alt + ↑ / ↓

This one alone changed how I code. Put your cursor on any line, hold the key, and use the arrow keys to move it up or down.

No more cut, scroll, paste. Just grab the line and move it. It works with multiple selected lines too, so you can move whole blocks around.

2. Duplicate lines up or down

Mac: Shift + Option + ↑ / ↓ | Windows/Linux: Shift + Alt + ↑ / ↓

The sibling of the last one. Instead of moving the line, this duplicates it above or below.

Perfect for when you’re writing a bunch of similar lines (like list items or CSS properties) and only need to change one small part in each copy.

3. Select the next matching word

Mac: Cmd + D | Windows/Linux: Ctrl + D

A game changer for renaming things. Click on a variable name, press the shortcut, and VS Code selects the next occurrence of that word. Keep pressing it to select more, then just type the new name and watch them all change at once.

Way faster than opening find-and-replace for quick edits.

4. Select ALL matching words at once

Mac: Cmd + Shift + L | Windows/Linux: Ctrl + Shift + L

And if you want to get it all at once… highlight a word, press this, and every single instance in the file gets selected.

My rule: Cmd + D for precision, Cmd + Shift + L when I’m sure I want all of them.

5. Add cursors above or below

Mac: Cmd + Option + ↑ / ↓ | Windows/Linux: Ctrl + Alt + ↑ / ↓

This duplicates your cursor straight up or down, line by line.

Great for editing multiple lines at the same column position, like adding something to the start of several lines at once.

6. Multi-cursor anywhere

Mac: Option + Click | Windows/Linux: Alt + Click

Probably the most fun one on this list. Hold the key and click in different places to drop multiple cursors wherever you want. Then whatever you type appears in all of them at the same time.

This is perfect for when you need to type the same thing in multiple spots but the surrounding text doesn’t match, so Cmd + D can’t help you. Think adding quotes around several items in a list, or appending commas.

7. Toggle comments

Mac: Cmd + / | Windows/Linux: Ctrl + /

Stop typing out comment slashes manually. Select a line (or a whole block), press it, and it’s commented out. Press again to uncomment.

The nice part is it works in every language. HTML, CSS, JavaScript, Python… VS Code figures out the right comment syntax for whatever file you’re in.

8. Find (and replace) in a file

Mac: Cmd + F | Windows/Linux: Ctrl + F

The classic. Opens find in the current file, and you can expand it into find-and-replace from there.

You probably know this one already, but combined with the selection shortcuts above, you now have three different ways to hunt down and change text depending on how surgical you want to be.

9. Quick file search

Mac: Cmd + P | Windows/Linux: Ctrl + P

If you’re clicking through folders in the sidebar to find a file, you’re taking on unnecessary work.

Press it and just start typing any part of the filename. It even does fuzzy matching, so typing “navcom” will find NavbarComponent.jsx. On big projects with 50-100+ files, this saves you so much time.

10. Split your editor

Mac: Cmd + \ | Windows/Linux: Ctrl + \

Splits your editor screen sideways so you can view two files side by side.

Super useful when you’re editing a component while looking at its styles, or referencing one file while writing another. No more jumping back and forth between tabs.

That’s it. Not 50 shortcuts. Just 10 that actually stick.

If even one of these was new to you, try using it today. It feels awkward for about a day, then it becomes muscle memory and you never go back.

Got a shortcut I missed? Drop it in the comments, I’m always looking for new ones.

I also made a video version of this where you can see each shortcut in action:

If you found this useful, follow me here on DEV and subscribe on YouTube so you don’t miss the next one. I’m posting more quick dev tips like this every week.

Happy coding! 🚀

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다