tl;dr; In VS Code you can copy the current line without first selecting it. Cmd-C without selection defaults to whole line.
One of those "How did I not know this until now?!?!"
VS Code is not emacs even though its emulation gets many things right. But one thing that I only just learned is that to copy a whole current line, you don't have to select it first. If nothing is selected, whichever line the cursor is on gets the entire line copied.
The regular way of doing it:
the keyboard use here is down, Ctrl-Shift-left, Ctrl-Shift-left, Cmd-C. Then moving down to a new line and Cmd-V
Here, note that the cursor is just somewhere on line 6:
the keyboard use here is down, down, Cmd-C, down, Cmd-V
Bonus
In this particular demo video, I'm just replicating line 6 and putting a copy of that on (new) line 8. There's actually another keyboard shortcut sequence for that: Option+Shift+down then Option+down
Option+Shift+down replicates the current line and puts a copy right below. Then Option+down moves the current line.
Comments