How to close a file in Intellij using a keyboard shortcut?

I know this is a simplified question; but I’ve been using IntelliJ for several months now and cannot find this simple function.

Any idea? Thank.

+48
intellij-idea
Jun 12 '11 at 15:35
source share
7 answers

Idiot of me. CMD - F4 or, as mentioned earlier, CTRL - F4 .

Thanks to everyone. I will just bury myself :)

+56
Jun 12 '11 at 15:47
source share

hmm you cannot because there is no default binding for this, at least on OSX, however you can go here and define one:

enter image description here

+33
Jun 12 '11 at 15:46
source share

The standard advice, if you don’t know how to do something in Idea, is "Find an action ..." ( ctrl + shift + A on Windows), then enter what you want to do in this case close .

You will get many different “close” actions and just “Close” ( ctrl + F4 on Windows) will be one of them.

+19
Nov 16 '11 at 12:22
source share

For the MAC user, Cmd-W will close the active tab (file).

+1
Dec 09 '14 at 10:43
source share

You can also set a custom key combination in the settings menu.

Click File > Settings and select Keymap in the menu on the left, then scroll down to the Other section and set the preferred key combination for Close Active Editor :

enter image description here

When you double-click on Close Active Editor , a pop-up menu appears that allows you to set a key combination, mouse gesture, or even an abbreviation for the action. If the shortcut is already installed in another place (as in my case with Ctrl-W ), you will receive a notification and cannot install the shortcut until you delete another.

+1
Nov 07 '16 at 15:33
source share

Like Matt Ball, I do not use IntelliJ, but there may also be CTRL + F4 ...

0
Jun 12 '11 at 15:41
source share

On a Mac, you can use CMD + W , as this is a regular shortcut to close things, for example. Tabs in Chrome.

But by default, this is usually associated with highlighting the current cursor block, so instead I use CTRL + W , rather than re-assigning.

eg. (bottom right)

enter image description here

Also works for other IntelliJ IDEs like WebStorm etc.

0
Nov 21 '16 at 13:06
source share



All Articles