If you have a selection, cut (Ctrl+X) will copy and delete the selection. If not, it will copy the whole line and delete it.
I want to disable the latter. It is close to save (Ctrl+S) and I don't want to delete my whole line when I want to save.
Can you disable the cut line function of cut shortcut (Ctrl+X) in VSCode?
What I have tried:
Add
whenclause tocut:editorHasSelection:Keyboard Shortcutsmenu looks like this:
My
keybindings.json:[ { "key": "ctrl+x", "command": "editor.action.clipboardCutAction", "when": "editorHasSelection" }, { "key": "ctrl+x", "command": "-editor.action.clipboardCutAction" } ]After saving and reopening VSCode,
cutstill works the same.Remove the second shortcut from
keybindings.json:My
keybindings.json:[ { "key": "ctrl+x", "command": "editor.action.clipboardCutAction", "when": "editorHasSelection" } ]Keyboard Shortcutsmenu changes to:
After saving and reopening VSCode,
cutstill works the same.
Info
- Ubuntu 20.04
- Visual Studio Code version 1.55.2
- Recreated on Code - Insiders 1.56.0-insider (13f1aff, 2021-04-28T04:52:56.570Z)