Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode: How to make tab key indent instead of changing focus? [duplicate]

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.

like image 289
sondra.kinsey Avatar asked Dec 05 '25 14:12

sondra.kinsey


2 Answers

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.

like image 107
sondra.kinsey Avatar answered Dec 08 '25 11:12

sondra.kinsey


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.

like image 32
Mark Avatar answered Dec 08 '25 11:12

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!