Close all tabs and/or tab groups except for the currently active one(s), inspired by the CloseOtherWindows Sublime Text extension
This VSCode extension helps you manage your open tabs and tab groups more efficiently. It provides three commands with customizable keybindings to close all non-active tabs within the same tab group, close all non-active tab groups, and close all non-active tabs in all tab groups.
You can access the commands via the Command Palette (Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS)) by searching for the following commands orby using their keybinding equivalents:
-
Close other (non-active) tab groups
Command:
Close other (non-active) tab groups
Keybindings:
- macOS:
Option ⌥
+Cmd ⌘
+Shift ⇧
+W
- Other:
Alt ⎇
+Super ❖
+Shift ⇧
+W
- macOS:
-
Close other (non-active) tabs in current tab group
Command:
Close other (non-active) tabs in current tab group
Keybindings:
- macOS:
Ctrl ^
+Cmd ⌘
+Shift ⇧
+W
- Other:
Ctrl ^
+Super ❖
+Shift ⇧
+W
- macOS:
-
Close other (non-active) tabs from left in current tab group
Command:
Close other (non-active) tabs from left in current tab group
Keybindings:
- macOS:
Ctrl ^
+Cmd ⌘
+Shift ⇧
+Left Arrow ←
- Other:
Ctrl ^
+Super ❖
+Shift ⇧
+Left Arrow ←
- macOS:
-
Close other (non-active) tabs from right in current tab group
Command:
Close other (non-active) tabs from right in current tab group
Keybindings:
- macOS:
Ctrl ^
+Cmd ⌘
+Shift ⇧
+Right Arrow ←
- Other:
Ctrl ^
+Super ❖
+Shift ⇧
+Right Arrow ←
- macOS:
-
Close other (non-active) tabs in each tab group
Command:
Close other (non-active) tabs in each tab group
Keybindings:
- macOS:
Ctrl ^
+Option ⌥
+Shift ⇧
+W
- Other:
Ctrl ^
+Alt ⎇
+Shift ⇧
+W
- macOS:
-
Close other (non-active) tabs and tab groups everywhere
Command:
Close other (non-active) tabs and tab groups everywhere
Keybindings:
- macOS:
Option ⌥
+Shift ⇧
+W
- Other:
Alt ⎇
+Shift ⇧
+W
- macOS:
Assume for all examples below that this filled circle symbol ●
denotes an active tab or tab group, and that the unfilled circle symbol ○
denotes a non-active tab or tab group.
● Group 1 │ ○ a.txt ○ b.txt ● c.txt
○ Group 2 │ ○ d.txt ● e.txt
○ Group 3 │ ● f.txt ○ g.txt
Close other (non-active) tab groups
Command: Close other (non-active) tab groups
Keybindings:
- macOS:
Option ⌥
+Cmd ⌘
+Shift ⇧
+W
- Other:
Alt ⎇
+Super ❖
+Shift ⇧
+W
Result:
● Group 1 │ ○ a.txt ○ b.txt ● c.txt
Close other (non-active) tabs in current tab group
Command: Close other (non-active) tabs in current tab **group
**
Keybindings:
- macOS:
Ctrl ^
+Cmd ⌘
+Shift ⇧
+W
- Other:
Ctrl ^
+Super ❖
+Shift ⇧
+W
Result:
● Group 1 │ ● c.txt
○ Group 2 │ ○ d.txt ● e.txt
○ Group 3 │ ● f.txt ○ g.txt
Close other (non-active) tabs in each tab group
Command: Close other (non-active) tabs in each tab group
Keybindings:
- macOS:
Ctrl ^
+Option ⌥
+Shift ⇧
+W
- Other:
Ctrl ^
+Alt ⎇
+Shift ⇧
+W
Result:
● Group 1 │ ● c.txt
○ Group 2 │ ● e.txt
○ Group 3 │ ● f.txt
Close other (non-active) tabs and tab groups erywhere
Command: Close other (non-active) tabs and tab groups **everywhere
**
Keybindings:
- macOS:
Option ⌥
+Shift ⇧
+W
- Other:
Alt ⎇
+Shift ⇧
+W
Result:
● Group 1 │ ● c.txt
You can install this extension from the Visual Studio Code Marketplace.
Feel free to submit issues, feature requests, or pull requests for this extension on the official GitHub repository.