Delete Line Shortcut (⌘⇧K / Ctrl+Shift+K)
Remove the current line without selecting it: press Ctrl+Shift+K on Windows or ⌘⇧K on Mac in VS Code.
| Action | Mac | Windows | |
|---|---|---|---|
| Delete line (VS Code) | ⌘⇧K | Ctrl+Shift+K | |
| Delete to end of line | ⌃K | (no default) | |
| Delete line (Sublime Text) | ⌘⇧K | Ctrl+Shift+K | |
| Delete line (JetBrains) | ⌘⌫ | Ctrl+Y | |
| Cut line (if nothing selected) | ⌘X | Ctrl+X |
Delete a whole line
In VS Code, press Ctrl+Shift+K (Windows/Linux) or ⌘⇧K (Mac) to delete the current line outright — no selection needed, and it does not overwrite your clipboard. If you would rather keep the line on the clipboard, press Ctrl+X / ⌘X with nothing selected and VS Code cuts the entire line.
Other editors
Sublime Text: Ctrl+Shift+K / ⌘⇧K. JetBrains IDEs: Ctrl+Y (Windows) or ⌘⌫ (Mac). To delete just from the cursor to the end of the line, VS Code on Mac uses ⌃K.
Troubleshooting
In JetBrains, Ctrl+Y is Delete Line — not Redo as in many Windows apps — which surprises people switching editors. If you delete the wrong line, Ctrl+Z / ⌘Z brings it straight back.
FAQ
How do I delete a whole line in VS Code?
Ctrl+Shift+K on Windows/Linux, ⌘⇧K on Mac removes the current line without needing a selection and without touching the clipboard.
How do I cut a line to the clipboard instead?
Press Ctrl+X / ⌘X with nothing selected — VS Code cuts the entire current line.
What is delete line in JetBrains IDEs?
Ctrl+Y on Windows/Linux or ⌘⌫ on Mac deletes the current line. Note Ctrl+Y is not Redo in JetBrains.
I deleted the wrong line — can I get it back?
Yes, press Ctrl+Z / ⌘Z to undo and the line returns exactly where it was.