HACKER Q&A
📣 overclk64

Favorite VS Code shortcuts, tips and tricks?


I want to streamline my editing and I'm looking for some interesting keyboard shortcuts, tips and tricks, and features in general.

I quite like how you can do a regex find/replace, for example.

Feel free to share below the ones you find the most helpful, and also to point me towards some resources (I found the subreddit quite useless).


  👤 runjake Accepted Answer ✓
Place a cursor at the end of every selected line:

1. Select the lines you want to do this with.

2. Press `Shift-Opt-i` on macOS and probably something like Shift-Alt-i on Windows/Linux.

Column Select:

1. Place curso where you want.

2. Hold Shift+Option and mouse down.

This and more covered here: https://code.visualstudio.com/docs/editor/codebasics


👤 smokel
Emacs key bindings through the "Emacs Friendly Keymap" extension [1]. I wonder if for newcomers it is still a good idea to learn Emacs keybindings. At least for those who did, we can use nearly any IDE with it. Don't forget to make Caps Lock an additional Control though.

As a second tip I cannot recommend Remote Development [2] enough.

And while I'm at it -- on a laptop with a crappy trackpad, multiple cursor support can be infuriatingly annoying. I can't seem to disable this "feature".

[1] https://marketplace.visualstudio.com/items?itemName=lfs.vsco...

[2] https://code.visualstudio.com/docs/remote/remote-overview


👤 sujayk_33
Don't remember if I have customized the shortcut or not but

- Ctrl + l - copy line down

- alt + up/down arrow - shift line above or below

- multi-cursor functionality

- Distraction-free mode

These in particular are most used and loved by me


👤 FinalDestiny
Cmd+Shift+L: Select all occurrences

Ctrl+g: Jump to line X

Are two of my favorites that came to mind


👤 aristofun
My favorite shortcuts preset is called IntelliJ Idea.

Saves ton of time when you’re coding in the flow and don’t have to stumble on unpolished and rough edges every second.


👤 octokatt
This ask unintentionally sets up a vote between Emacs and vim keybindings, and I'm looking forward to seeing which wins.

👤 gt2
cmd + shift + e to focus the explorer

cmd + b to toggle it open and closed

cmd + [any number] focuses split panes (and opens one if it doesn't exist yet)

control + [any number] to focus different files open in the existing pane


👤 blotato
vim mode

👤 lgkk
Is there a way to show how many lines I’ve selected?

👤 joshxyz
ctrl p and ctr shift p thats all i know lol