4 ms·
Ask HN: 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).
- FinalDestiny 3y agoCmd+Shift+L: Select all occurrences Ctrl+g: Jump to line X Are two of my favorites that came to mind
- aristofun 3y agoMy 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.
- swah 3y agoIf it was fast as VSCode or Sublime I could get used to it...
- octokatt 3y agoThis ask unintentionally sets up a vote between Emacs and vim keybindings, and I'm looking forward to seeing which wins.
- sujayk_33 3y agoDon'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
- lgkk 3y agoIs there a way to show how many lines I’ve selected?
- gt2 3y agoThere's an extension for it, or you can add a cursor to the end of each selected line and look at the number of selections in the status bar.
- gt2 3y agocmd + 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 3y agovim mode
- joshxyz 3y agoctrl p and ctr shift p thats all i know lol
- runjake 3y agoPlace 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 https://code.visualstudio.com/docs/editor/codebasics
- smokel 3y agoEmacs 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.vscode-emacs-friendly https://marketplace.visualstudio.com/items?itemName=lfs.vsco... [2] https://code.visualstudio.com/docs/remote/remote-overview https://code.visualstudio.com/docs/remote/remote-overview
- swah 3y agoC-HJKL for movement help me a little bit: https://tonsky.me/blog/cursor-keys/ https://tonsky.me/blog/cursor-keys/ - particularly on a laptop keyboard.