Home > Back-end >  Can't use escape backspace to delete a word in Visual Studio Code
Can't use escape backspace to delete a word in Visual Studio Code

Time:12-01

Running VS Code on WSL.

I have tried opening keybindings.json at [USER]/AppData/Roaming/Code/User/keybindings.json

... and adding the following:

  {
    "key": "escape backspace",
    "command": "deleteWordLeft",
    "when": "textInputFocus && !editorReadonly"
  }

To no avail. This despite the fact that:

{
    "key": "ctrl backspace",
    "command": "deleteWordLeft",
    "when": "textInputFocus && !editorReadonly"
}

Works as intended. Is there some other escape command that I need to remove/disable?

CodePudding user response:

According Key Bindings for Visual Studio Code, for Modifier keys only Ctrl , Shift , Alt and Meta/Win/Cmd are accepted, so it seems that escape is not considered valid.

CodePudding user response:

Whilst you can not use escape as a modifier, you can still use escape backspace to delete a word in Visual Studio Code

  {
    "key": "escape backspace",
    "command": "deleteWordLeft",
    "when": "textInputFocus && !editorReadonly"
  }

Notice the space between escape and backspace, you need to type escape followed by backspace, not simutaneously.

  • Related