In order to cut the current line that your cursor is on Visual Studio Code (VS Code) make use of the below keyboard shortcuts based on the Operating System you are on.
Windows
Control + X
macOS
⌘ Command + X
Linux
Control + X
Demo:

As you would see in the above demo gif image, initially the cursor was on line 3, and Command + X keys were pressed causing the line 3 to be cached in the clipboard and the lines below it were moved up.
Make use of the standard keyboard short (Control + V or Command + V on macOS) to paste the line that you just cut.
How to delete the current line?
If you want to delete (and not cut) the current line, make use of the below keyboard shortcut
Windows
Control + ⇧ Shift + K
macOS
⌘ Command + ⇧ Shift + K
Linux
Control + ⇧ Shift + K
Note this will not copy the deleted line into the clipboard.
Both cut and delete the line's shortcut also works to remove empty lines.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!