k13i
k13i

Reputation: 4351

How to close other tabs in IntelliJ using keyboard shortcut?

Is there any default keyboard shortcut to close all tabs except the active one? It can be done by right-clicking the tab and choosing Close Others but I'd like to do this using only my keyboard.

enter image description here

Upvotes: 4

Views: 2195

Answers (2)

Matsemann
Matsemann

Reputation: 21844

ctrl+shift+a and write Close Others. Select the one with Editor Close Actions.

Or assign it your own shortcut. Open Settings > Keymap. Search for Close others (or find it under Main menu > Window > Editor tabs.

Upvotes: 6

glytching
glytching

Reputation: 48015

It's not possible to access the tab context menu using the keyboard.

There's an open issue against IntelliJ for this.

Their suggestion is to add that action (tab > close others) to a quick list and you can then invoke the quick list action via a keyboard shortcut.

Upvotes: 2

Related Questions