Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force VSCode to have only 1 file opened

I want VSCode to have only a single file tab (editor) at a time. When I switch files VSCode should replace the opened file with a new one instead of creating a new tab (editor) for it.

"workbench.editor.showTabs": false makes it so that there is only 1 tab visible. This is exactly how I want things to look like, but under the hood VSCode still creates a new tab for each file. You can see them if you set this parameter back to true or try to cycle through tabs with Ctrl+Tab.

like image 443
synalice Avatar asked Nov 06 '25 21:11

synalice


1 Answers

There are these 3 settings that do exactly what I want to achieve:

// Disable tabs visually
"workbench.editor.showTabs": false,
// Enable the limit for number of opened tabs
"workbench.editor.limit.enabled": true,
// Set max amount of opened tabs. Older tabs will be closed
"workbench.editor.limit.value": 1,

There is also an extension called zentabs but has some flaws and is pretty much obsolete since what it does can be achieved natively.

like image 136
synalice Avatar answered Nov 10 '25 06:11

synalice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!