66

I love intellij's file tab but I can't seem to find a way to shortcut closing a tab similar to the behavior of ctrl + w in chrome. I can't find the option in the keymap editor. Am I missing something or is this not implemented?

I found this page but it doesn't include the action name. I would use ctrl + f4 but my window manager has that reserved and I would rather change it.

6 Answers 6

90
  1. Open Settings by hitting Ctrl+Alt+S
  2. Click: Keymap
  3. Search for: Close
  4. Under Main menu > Window > Editor Tabs, find Close.
  5. Right-click and click Remove Ctrl+F4.
  6. Right click and click Add Keyboard Shortcut
  7. Add your new custom Keyboard Shortcut.

IntelliJ will tell you if the shortcut clashes with another shortcut performing a different action.


Alternatively, open/edit your Linux Window Manager Settings and remove the Ctrl+F4 mapping to allow other programs like IntelliJ to make use of it.

2
  • 1
    On Ubuntu KDE Neon, this shortcut didn't work because it was already in use by the KDE with the function: "Switch to Desktop 4". I disabled this shortcut in the Settings -> Workspace -> Shortcuts -> Global Shortcuts -> KWin -> Switch to Desktop 4.
    – moobi
    Feb 1, 2019 at 6:55
  • 1
    More in line with what you're looking for, OP, after step 5, also remove the existing Ctrl+W shortcut (Window > Active Tool Window > Close Active Tab), and remap the Editor Tabs > Close shortcut to Ctrl+W
    – Matej
    Sep 13, 2019 at 18:13
18

For PC-based keyboards, the shortcut to close tabs is CTRL + F4,
not to be confused with ALT+F4.

3
  • My window manager on linux already has a mapping for that. Do you know what the action that corresponds to is? I found this page but it doesn't say what the action is: jetbrains.com/idea/help/closing-files-in-the-editor.html Mar 14, 2016 at 16:15
  • @inquisitiveIdiot: It'd be the "Close" action.
    – Makoto
    Mar 14, 2016 at 16:27
  • If you use open Settings (Ctrl+Alt+S), then go to "Keymap". Search for "Close" and then add another shortcut (eg. Ctrl+#).
    – Harmelodic
    Mar 14, 2016 at 16:35
8

Current tab can be closed with:

Ctrl + F4

Works on Intellij Ultimate 2016.3

4

On mac OS, Intellij 2018.3 version, 'Command + W' does close the file tab. enter image description here

0

As we can see in the image in this discussion:

Go in Settings >> Keymap >> Main menu >> Other >> [Close Active Editor] and change to Ctrl+W.

0

I'm on version 2020.1 and this has changed to Ctrl+4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.