Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code tab width

Is there any way to set the maximum width for the tab in visual studio code. I can specify this in visual studio 2015 when I install productivity power tool, but I want to know if this is possible with visual studio code. enter image description here

like image 964
Shinya Koizumi Avatar asked Oct 15 '18 17:10

Shinya Koizumi


People also ask

How do you change the tab width in VS Code?

Type “Indentation” into the search field then head to the “Editor: Tab Size” section. Replace the default space number with your preferred one: Your setting will be applied and reflected immediately. If this doesn't happen (it's a little lag sometimes), just reload or restart your VS Code.

What is tab size in VS Code?

By default, VS Code inserts spaces and uses 4 spaces per Tab key.


3 Answers

The only thing I was able to find while doing some quick research on VS Code User Guide was that in the Settings editor you can change the tabWidth either to shrink or to stay large enough to view the file name.

  // Controls the sizing of editor tabs.
  //  - fit: 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.
  "workbench.editor.tabSizing": "fit",
like image 53
B. Cratty Avatar answered Oct 20 '22 18:10

B. Cratty


In VS Code you can access the editor's tab size settings by pressing Command+Comma (Mac) or Ctrl+Comma (PC), and typing tabsizing. You can edit settings for regular and pinned tabs.

Currently there are two options for sizing editor tabs: fit and shrink.

Dialog to edit tab sizing in VS Code

A handy shortcut is that the tab area recognizes a mouse scroll-wheel.

If you have Tab Sizing set to fit, and you have several tabs opened so that they scroll off the screen, hover your mouse pointer over a tab then scroll. This will bring more tabs into view.

It would be nice if Microsoft provided a means to stack tabs in Visual Studio Code.

2022 Update: VS Code now has a workbench setting named Wrap Tabs. To edit this press Command+Comma (Mac) or Ctrl+Comma (PC), type Wrap Tabs and check that box.

enter image description here

like image 6
Ken Palmer Avatar answered Oct 20 '22 17:10

Ken Palmer


As lenooh pointed out, to have smaller tabs (what I came here for), better use "workbench.editor.tabSizing": "shrink",

like image 2
Computer's Guy Avatar answered Oct 20 '22 16:10

Computer's Guy