Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Close Tabs via RegexNew to Visual Studio Code? Get it now.
Close Tabs via Regex

Close Tabs via Regex

fardolieri

|
85 installs
| (1) | Free
Adds a command that closes all tabs that match a given regex.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Motivation

I often find myself having too many tabs open. Many of them are Working Tree diffs. I needed a simple way to close them.

Usage

Either use the Close Tabs via Regex command or better yet, create a shortcut and pass your regex as an argument.

Example

// keybindings.json
[
  {
    "key": "ctrl+alt+c",
    "command": "close-tabs-via-regex.close",
    "args": "\\(", // Close all tabs that contain an opening bracket
  }
]
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft