简体   繁体   English

Visual Studio Code 选项卡宽度

[英]Visual Studio Code tab width

Is there any way to set the maximum width for the tab in visual studio code.有没有办法在 Visual Studio 代码中设置选项卡的最大宽度。 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.当我安装生产力工具时,我可以在 Visual Studio 2015 中指定这一点,但我想知道这是否可以通过 Visual Studio 代码实现。 在此处输入图像描述

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. 在对VS Code用户指南进行快速研究时,我唯一能够找到的是,在设置编辑器中,您可以将tabWidth更改为缩小或保持足够大以查看文件名。

  // 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",

In VS Code you can access the editor's tab size settings by pressing Command+Comma (Mac) or Ctrl+Comma (PC), and typing tabsizing .在 VS Code 中,您可以通过按Command+Comma (Mac) 或Ctrl+Comma (PC) 并键入tabsizing来访问编辑器的选项卡大小设置。 You can edit settings for regular and pinned tabs.您可以编辑常规和固定选项卡的设置。

Currently there are two options for sizing editor tabs: fit and shrink .目前有两种调整编辑器选项卡大小的选项: fitshrink

在 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.如果您将Tab Sizing设置为fit ,并且打开了多个选项卡以便它们滚动到屏幕外,则 hover 将鼠标指针悬停在选项卡上然后滚动。 This will bring more tabs into view.这将带来更多选项卡。

It would be nice if Microsoft provided a means to stack tabs in Visual Studio Code.如果 Microsoft 提供了一种在 Visual Studio Code 中堆叠选项卡的方法,那就太好了。

2022 Update: VS Code now has a workbench setting named Wrap Tabs . 2022 年更新: VS Code 现在有一个名为Wrap Tabs的工作台设置。 To edit this press Command+Comma (Mac) or Ctrl+Comma (PC), type Wrap Tabs and check that box.要编辑此内容,请按Command+Comma (Mac) 或Ctrl+Comma (PC),键入Wrap Tabs并选中该框。

在此处输入图像描述

As lenooh pointed out, to have smaller tabs (what I came here for), better use "workbench.editor.tabSizing": "shrink",正如 lenooh 指出的那样,要拥有更小的标签(我来这里的目的),最好使用"workbench.editor.tabSizing": "shrink",

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM