Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Romly Auto-Close Header Source SwitchNew to Visual Studio Code? Get it now.
Romly Auto-Close Header Source Switch

Romly Auto-Close Header Source Switch

Romly

|
2 installs
| (0) | Free
Automatically closes the corresponding header or source file when switching between them (Alt+O)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Romly Auto-Close Header Source Switch

日本語(Japanese)

English version below

C/C++のヘッダー/ソース切り替え(Alt+O)時に、切り替え前のタブを自動的に閉じる拡張機能です。実質的に1つのクラスに対して常にタブが1つしか存在しない状態になるので、タブバーがすっきりします。

機能

  • ヘッダー/ソース切り替え後に、切り替える前のタブを自動的に閉じる。
  • 全てのタブグループのヘッダー/ソースファイルを閉じるか、同じタブグループにあるファイルのみ閉じるかを設定可能。

必要条件

  • VSCode バージョン1.107.0以上
  • C/C++拡張機能。内部で "C/C++: ヘッダー/ソースの切り替え (C_Cpp.SwitchHeaderSource)" コマンドを使用します。

拡張機能の設定

  • Romly-AutoCloseHeaderSourceSwitch.closeScope: ヘッダー/ソースの切り替え後、自動的に閉じるタブを検索する対象となるタブグループを設定します。
    • currentGroup: 現在のタブグループにあるタブのみ閉じます。
    • allGroups: 全てのタブグループにある対応するタブを閉じます。

既知の問題

  • 標準で "C/C++: ヘッダー/ソースの切り替え" と同じ Alt+O を割り当てます。ショートカットキーが衝突するので、必要に応じて調整して下さい。実質的にはそのままでも後からインストールしたこの拡張機能のコマンドが優先されるようです。

リリースノート

変更ログ CHANGELOG.md をご覧下さい。


English(英語)

日本語版(Japanese version above)はこちら

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.

Release Notes

Please see the CHANGELOG.md.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft