简体   繁体   中英

Tidy Tabs, but for VSCode?

I really miss the "tidy tabs" extension that automatically closes tabs older than a certain age in Visual Studio. Is there any extension for VSCode with similar functionality?

As of version 1.42 , we can now set a maximum number of tabs to leave open in each window, which effectively replicates tidy tabs.

Limit the number of open editors

There are new settings to limit the maximum number of editors that are open at the one time.

  • workbench.editor.limit.enabled: Enable this feature (off by default).
  • workbench.editor.limit.perEditorGroup: Whether to apply the limit per editor group or across all groups.
  • workbench.editor.limit.value: The maximum number of open editors (10 by default).

If enabled, VS Code will close the least recently used editor when you open a new editor.

There is zentabs (inspired by zentabs for Sublime Text). It works but with some caveats:

It only closes an old tab when a new one is opened, so it won't help to clean up an existing tab-heavy session, but it should help to prevent it from growing any larger.

Due to VSCode extension limitations, it will briefly switch to any tab it decides to close. You may see this as a temporary flicker when you open a new tab.

As a result, it will sometimes bump the old closed window up to the top of the most-recently-used list on Cmd-P / Ctrl-P, which can be unintuitive.

It also asks you to disable the preview feature (opening unpinned tabs when stepping through searches). That is a shame because that VSCode feature let us do a lot of searching without cluttering our tabs too much.

Under some circumstances (when using search?) I end up with more tabs open that my prescribed limit.

If a file is unsaved when its tab is closed, VSCode will show a popup asking if you want to save the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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