Last updated: Apr 6, 2024
Reading time·4 min
The most common reason for the Tab key not working issue in VS Code is when you accidentally enable the Tab Moves Focus command.
The command can be toggled with the following keyboard shortcut:
Ctrl
+ M
.Cmd
+ Shift
+ M
.If the Tab Moves Focus command is active, pressing the tab key moves the focus in your editor instead of inserting a Tab character.
If the command is active, a Tab Moves Focus label is displayed at the bottom of the editor, in the Status Bar.
Make sure the label is not displayed, for you to be able to use the Tab key as intended.
You can also trigger the command via the Command Palette:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.Another way to disable the command is to click on the Tab Moves Focus label in your Status Bar.
Another thing that you can do is remove the keyboard shortcut, so you don't trigger the Tab Moves Focus command by mistake.
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.Another thing you need to check is that your settings are correct.
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.You can also open the settings screen by pressing Ctrl
+ ,
on Windows and
Linux or Cmd
+ ,
on macOS.
If you are trying to enable tab auto-completions in VS Code, you have to enable the setting.
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.You can also open the settings screen by pressing Ctrl
+ ,
on Windows and
Linux or Cmd
+ ,
on macOS.
on
.The Editor: Tab Completion setting has 3 possible values:
on
- Tab complete inserts the best matching suggestion when pressing Tab.off
- Tab completions are disabled.onlySnippets
- Tab complete snippets when their prefix matches.When the Emmet: Trigger Expansion On Tab setting is enabled, Emmet abbreviations are expanded when pressing Tab.
You can also enable tab auto-completions directly in your settings.json file.
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.Type user settings json.
Click on Preferences: Open User Settings (JSON)
settings.json
file"editor.tabCompletion": "on", "emmet.triggerExpansionOnTab": true,
Make sure to remove the trailing comma if the property comes last.
If the issue is not resolved, try to restart VS Code.
Press F1
, type Reload Window and select Developer: Reload Window.
Or simply close VS Code completely and reopen it.
You can learn more about the related topics by checking out the following tutorials: