17

When I press the Tab key in an open editor window in Visual Studio Code, the focus changes from the editor pane to other window components.

Instead, I would like it to indent text.

This behavior is not impacted by which Language Mode is active. I would also like Shift+Tab to dedent/un-indent, which currently also changes focus of editor components, but in reverse order.

I'm not sure how vscode changed from my desired behavior from the current behavior; it has always functioned in my desired way until it unexpectedly changed today.

4
  • Check the keybindings for Tab - one of them should have the command tab and an editorTextFocus && ... when clause. Is that one missing? Commented Oct 1, 2021 at 15:18
  • @Mark: Keybinding is: editorTextFocus && !editorReadonly && !editorTabMovesFocus Commented Oct 2, 2021 at 12:39
  • 3
    I must have hit Ctrl+M on accident. Duplicate of stackoverflow.com/q/56921891/5389585 Commented Oct 2, 2021 at 13:42
  • @sondra.kinsey I suggest you answer your own question and accept it. The question title is to the point and many people (who are impatient like me) will decide to scroll down to answers after having read only that. Commented Dec 28, 2021 at 16:43

2 Answers 2

40

Type Ctrl+M. This feature is called "Tab Trapping". When active, the words "Tab Moves Focus" appear in the status bar, and you can also deactive the feature by clicking these words. You probably activated this inadvertently by typing the Ctrl+M sequence, which toggles this setting.

Sign up to request clarification or add additional context in comments.

Comments

4

You can disable the command Toggle Tab Key Moves Focus with this in your keybindings.json:

  {
    "key": "ctrl+m",
    "command": "-editor.action.toggleTabFocusMode"
  }

or right-click on thetat command in the Keyboard Shortcuts editor and choose Remove Keybinding and then you would be unable to accidentally engage the Tab Moves Focus mode in the future.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.