Hacker News new | ask | show | jobs
by cyberferret 3517 days ago
As much as I wanted to like Atom over VS Code, I find myself changing and starting most of my new projects in VS Code exclusively.

One thing that surprised me that VS Code didn't have was multiple cursors?? (like Atom and Sublime have by default). I didn't realise how much I use that feature (for renaming variables in a short procedure/function block etc). There is probably a plugin for that somewhere, I guess.

3 comments

Ah, Thanks - I see now the shortcut is [Alt-click] as opposed to [Cmd-click] in the other two editors. I just didn't dig around enough to find the right key combination. But I guess this shows how ingrained muscle memory and habits are hard to change, and why certain editors remain people's favourites.
Be warned though... this is one area where vscode is noticeably worse than atom or sublime; There's no alt-click-drag support so making a rectangular edit is much more work; you manually create the correct selection on each line. It's one of the few things I miss from Atom (and one of the main reasons I switched to textmate way way back).
alt+shift+click-drag mate. Drag a rectangle and hit an arrow key seems fastest to make a column.
It actually does have multi cursor. Try cmd + D to highlight multiple instances of a selected block, just like in sublime.
Thanks for the additional useful tip. My usage of this feature is usually via 'brute force', i.e. Cmd-click (or Cmd-double click) on multiple points in my code and begin typing. This shortcut will make variable renaming a LOT easier.
Maybe you should also learn that ctrl+k skip one of the selections, so you can rename things and skip the ones that you don't want to change pretty fast when combined with ctrl+d.
The keyboard modifier for an additional cursor is Alt instead of Ctrl in VS Code. Maybe that's why you haven't found it.
Yes, that was it. Damn that muscle memory! :)