Delete a line in Visual Studio without copying it?
By default, if you are using the C# default profile, you can delete a line using Ctrl + Shift + L.
In linux (ubuntu), you can use Ctrl + Shift + K.
You can customize this using Tools->Customize
. Select "Keyboard". Look for the command Edit.LineDelete
to assign it to whichever keyboard shortcut you like.
If you got here looking for an answer for Visual Studio Code the default shortcut is:
ctrl + shift + K for Windows
⌘ + shift + K for MacOS
However, you can change on File > Preferences > Keyboard shortcuts
{
"key": "ctrl+shift+delete",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
}
For Visual Studio answer see @heavyd's answer
Ctrl + Shift + K
will work fine for both Windows and Linux.