An VSCode extension that automatically closes the previous tab when switching between C/C++ header/source files (Alt+O). This effectively ensures that only one tab exists for each class at any given time, keeping your tab bar clean and organized.
Features
Automatically closes the previous tab after switching between header/source files.
Configurable to close header/source files across all tab groups, or only within the same tab group.
Requirements
VSCode version 1.107.0 or later.
C/C++ Extension. It uses "C/C++: Switch Header/Source (C_Cpp.SwitchHeaderSource)" command internally.
Extension Settings
Romly-AutoCloseHeaderSourceSwitch.closeScope: Sets the target tab groups to search for tabs to automatically close after switching between header/source files.
currentGroup: Closes only tabs in the current tab group.
allGroups: Closes corresponding tabs in all tab groups.
Known Issues
By default, assigns Alt+O, which is the same as the "C/C++: Switch Header/Source" command. Please adjust the keyboard shortcut as needed to avoid conflicts. In practice, it appears that this extension's command (installed later) takes priority.