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

Your email will never ever be published.

Previous:
logger.error or logger.exception in Python March 6, 2026 Python
Related by category:
xbar-my-prs Info about your GitHub PRs in the macOS menu bar January 29, 2026 macOS
Set up iTerm to delete whole words on Option-Backspace May 13, 2025 macOS
gg2 - a new CLI for helping me manage git branches August 6, 2025 macOS
How to count the number of non-blank lines with Bash September 3, 2025 macOS