How to make backspace behave as backspace in Visual Studio Code

In Visual Studio Code I indent using two manually inserted blanks. When I press backspace this deletes two blanks at the same time.

How can I turn off this behavior? I want a backspace to "eat up" exactly ONE blank, especially if the blank is a blank and not a tab.

The question is just the opposite to Deleting tabs when using tabs as spaces.

Upvotes: 2

Views: 879

Answers (1)

rioV8
rioV8

Reputation: 28703

with extension multi-command you can create a keybinding that does what you want

add to keybindings.json (at the end) this will overrule the default backspace behavior

  {
    "key": "backspace",
    "command": "extension.multiCommand.execute",
    "when": "editorTextFocus && !editorHasSelection",
    "args": { 
        "sequence": [
            "cursorLeft",
            "deleteRight"
        ]
    }
  }

Edit

Added && !editorHasSelection to get the default behavior when there is a selection

Upvotes: 1

Related Questions