Last updated: Apr 6, 2024
Reading time·3 min
The default behavior in VS Code is for there to be a horizontal scrollbar when the width of the opened tabs exceeds the width of the editor.
However, in some cases, it might be more convenient to be able to see all of the opened tabs without having to scroll.
To wrap tags to multiple lines in VS Code:
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 the Editor: Wrap Tabs setting is enabled, tabs are wrapped over multiple lines when they exceed the available space.
If the setting is disabled, a scrollbar appears instead.
Here is a screenshot of the behavior when the setting is enabled.
If you want to make your tabs more compact, you can also set the tabSizing
property to shrink
.
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.
shrink
.The tab sizing setting controls the sizing of the editor tabs.
There are 2 possible values:
fit
(default value) - always keep tabs large enough to show the full editor
label.shrink
- allow tabs to get smaller when the available space is not enough to
show all tabs at once.There is also another setting you can disable if you want to make your tabs take up less space - the git decorations.
The letter M
(Modified) comes
from Git.
There is a Git Decorations: Enabled setting that you can disable if you want to remove the coloring and badges in Explorer and next to the tag names.
You could uncheck the checkbox in your settings, however, this feature is quite useful when working with Git in VS Code.
You could also hide the tab close button to make your tabs take up less space.
The setting is called Tab Close Button.
When the Tab Close Button setting is set to off
, close buttons are
disabled, so you have to use a
keyboard shortcut to close a tab:
Ctrl
+ W
Cmd
+ W
You can also directly set the given properties by editing 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)
"workbench.editor.wrapTabs": true, "workbench.editor.tabSizing": "shrink",
Remove the trailing comma if there are no properties that follow.
Also note that setting the tabSizing
property to shrink
is not necessary for
tabs to wrap to multiple lines.
I've also written an article on how to switch to the previous/next tab in VS Code.
You can learn more about the related topics by checking out the following tutorials: