Shortcut to Close Intellij File Tab

Intellij Idea

Intellij Idea Problem Overview


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 https://www.jetbrains.com/idea/help/closing-files-in-the-editor.html">page</a> 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.

Intellij Idea Solutions


Solution 1 - Intellij Idea

  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.

Solution 2 - Intellij Idea

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

Solution 3 - Intellij Idea

Current tab can be closed with:

> Ctrl + F4

Works on Intellij Ultimate 2016.3

Solution 4 - Intellij Idea

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

Solution 5 - Intellij Idea


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.

Solution 6 - Intellij Idea

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionford prefectView Question on Stackoverflow
Solution 1 - Intellij IdeaHarmelodicView Answer on Stackoverflow
Solution 2 - Intellij IdeaMakotoView Answer on Stackoverflow
Solution 3 - Intellij IdeaAndriusView Answer on Stackoverflow
Solution 4 - Intellij IdeafstangView Answer on Stackoverflow
Solution 5 - Intellij IdeaGabriel P. HahnView Answer on Stackoverflow
Solution 6 - Intellij IdeaMustapha-BelkacimView Answer on Stackoverflow