Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 742
blueray Avatar asked Jan 23 '20 05:01

blueray


2 Answers

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

like image 184
Bhargav Tailor Avatar answered Nov 04 '22 05:11

Bhargav Tailor


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.

like image 13
AndyJ Avatar answered Nov 04 '22 05:11

AndyJ