Reputation:
In VSCode, we can use a shortcut to delete the current line. But sometimes I want to rewrite the current line, so I don't want to delete the line when we are deleting all the words. Is there any way to delete all words but don't delete the current line?
Upvotes: 7
Views: 9904
Reputation: 1462
Upvotes: 0
Reputation: 5943
I looked through Keyboard Shortcuts of VS Code, it doesn't have such thing as deleting contents of a line and leaving the empty line.
You can use one of the following combinations:
Upvotes: 5
Reputation: 180651
There is a useful command deleteAllLeft
and deleteAllRight
which are unbound by default. So try in your keybindings.json
:
{
"key": "ctrl+shift+backspace",
"command": "deleteAllLeft"
}
It will delete any indentation on the left as well - until your formatter kicks in however you have it set up.
Upvotes: 11