Keyboard shortcut to close active file tab?!

Answered

I'm using Eclipse shortcuts and I hit Ctrl+W to close the file tab I'm looking at but it collapses the Project window, and I go to Keymap settings and there's nothing I recognize there as to close the active file tab.

17 comments
Official comment

Hi,

 

You can customize your shortcuts. By default ctrl+w goes for "Extend Selection". You can assign this combination under Settings > Keymap > Main menu > Window > Editor Tabs > Close (Alt+f4 by defaul).

 

Thanks!

Hi there,

On "Settings/Preferences | Keymap" look for "Main Menu | Window | Editor Tabs | Close" action and assign any desired shortcut.

From what I see the default shortcut for this action using Eclipse keymap is Ctrl+F4

2

It would also be nice if CTRL+W closed a tab in the Editor window. Or if there was some keyboard shortcut to closing a tab. Every time I have to touch my mouse when coding, a part of me dies a little. ;)

Please, someone either tell me how to do this, or please add this enhancement to TOAD. Most Windows applications use CTRL+W to allow for the closing of the active file or tab.   

1

Hmmm, I'm with acemary mary and have been trying to get ctrl-w to work. Currently it's the second short-cut assigned to close active tab but doesn't work. Any ideas why not?

1

Screenshots please.

So far it sounds like you assigning that shortcut to a wrong action ... or there is another action for that shortcut which cancels yours.

0

Oops! You were right, sorry: I confused "close" and "close active tab", apparently. I assigned ctrl+w to "close" and now it does what I want.

 

1



I can't get this working. The only close active tab that exist is for active tool window, and that closes the project view. How do you set it up to close the active editor tab? 

0

>How do you set it up to close the active editor tab? 

Just assign shortcut to the correct action

PhpStorm 2017.1.4 on Windows 10:

2

Thank you for the clarification. I would never have came up with the idea to search for Close Active Editor, even if i had seen that one i would not associate it to closing the current tab i am on.

 

2

Well .. that's "more correct" / dedicated action.

The one in my first comment (and one in the comment with "official" label) still works fine. It just that it has small downside (which you may never face or notice it) -- it can also close "other" tabs not just Editor ones (e.g. tabs in Search Results etc).

0

I think Jetbrains should reconsider this default. (I use IntelliJ Ultimate and have the same problem). If you have a tabbed interface, ctrl+w is pretty much expected to close the current tab. If not, it is supposed to close the current "W"indow. Browsers are prime example of doing this right.

Also, what Endasil did above makes perfect sense. It should have done what "Close Active Editor" mapping do, what other purpose it serves?

Thanks!

1

There's been a lot of discussion about that, but the platform team decided to keep things intact.
https://youtrack.jetbrains.com/issue/IDEA-118942

0

Wow, this is as binary as it gets. I understand making bad decisions but not acknowledging it or getting anchored to them for backward compatibility is worse.

0

I didn't read https://youtrack.jetbrains.com/issue/IDEA-118942 and I won't.

The decision is blatantly wrong because an editor is not a tab.

"Close Active Editor" should do as it says and close the editor tool, with all tabs in it.

Since it just closes a tab this is an error, by the grammatical pow, by the user interface pow, and it is also against a universally standardized behaviour.

1

Changing the "Keymap" from "Mac OS X" to "Mac OS X 10.5+" makes Cmd+W close editor tabs.

Currently using RM 2018.1.4.

1

I too would really, really like this to be fixed.  If backwards compatibility is the problem, perhaps you can do something as with Mac and introduce a new keymap.  My platforms: Debian & Ubuntu.  When I must: OSX.

0

Please sign in to leave a comment.