VSCode - Shortcut to copy Current Line
What is the shortcut to copy current line in VSCode?
I know we can Ctrl+L
to select the line then Ctrl+C
to copy. But is there any better solution. For example, in Geany, we can Ctrl+Shift+C
to copy the line where the cursor is.
To be clear I am not talking about Duplicate line in Visual Studio Code
Solution 1:
Here is your solution for your problem
Just press the Ctrl + C without selection it'll copy entire line and you can past it wherever you wanted,
Please read below solution for the query you ask in your question's comment
Stackoverflow don't have the close option but you can delete the question from you profile or you can follow the explaination to mark your question closed from the below link:
https://shodhganga.inflibnet.ac.in/bitstream/10603/32435/11/11_chapter%203.pdf
Solution 2:
Another alternative to the accepted answer that I often use is SHIFTALTDOWN which duplicates the current line to the line below (likewise, SHIFTALTUP duplicates to the line above). Once you get the copy of your line you can use ALTUP/ALTDOWN to move it wherever you want. This works well if you are wanting a copy of the line in the near vicinity of the current line.