How to close other tabs in IntelliJ using keyboard shortcut? - intellij-idea

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.

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.

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.

Related

Navigating project files in intellij idea

I want to jump through files in the project window using the up / down buttons. Now I press the down button, then press the enter button and the focus goes to the code editor window. But I do not want the focus to go away, I want to continue jumping through the files, pressing the down button and enter when I want to open the file. I can do this using this combination: down arrow, enter, F12, down arrow, down arrow, enter, F12 ...
Is there any way to tweak this to avoid using F12?
I'm using Intellij idea 2020.3
I'd suggest reassigning shortcut combination Main Menu | Window | Active Tool Window | Jump to Last Tool Window to anything more suitable for you, e.g. ESC and be sure that you don't use the same shortcut for other actions and operations.

Zerobrane hotkeys to jump between editor tabs and other panes within IDE

Using Zerobrane, are there any defined hotkeys or keymaps that will jump between panes within the IDE? Like, some key to jump between several files open as tabs (jump between tabs). Another is jumping from editor tab pane over to the project pane, etc...
To jump between tabs you can you Ctrl-PgUp/PgDn or Ctrl-(Shift-)Tab. Also, Ctrl-P will open a command panel with the list of currently open files, and after selecting a file from the list press Enter to jump to the tab with that file.
Jumping to Project tab and Console is not available, but moving between tabs there can be done using the same Ctrl-PgUp/PgDn combination. I'll consider adding some hotkey to move between open panes.
Update 7/13: Something like this may work as a simple workaround (add to the IDE config file as Edit > Preferences > Settings: User):
ide:SetHotKey(function()ide:GetProjectTree():SetFocus()end, "Ctrl-Alt-P")
ide:SetHotKey(function()ide:GetOutlineTree():SetFocus()end, "Ctrl-Alt-O")
Other panes (Output/GetOutput(), Console/GetConsole(), etc.) can be done in a similar way.

Is it possible to view one file in a new window in intellij-idea?

What I actually want to do is to view different files in a some project on different screens.
If they are in different windows, I can easily drag one window to another screen.
It's fine if there are other ways can do this. I'm using windows7.
You can drag the editor tab to another screen and it will open in a separate window. See the Detaching Editor Tabs help section for details.
Shift+F4 does the same:
The shortcut can be changed here:
You have to add a new keyboard shortcut in your keymap.
The action is called Open In New Editor Window
Then when searching for a class using Ctrl + n (go to Class...) or Ctrl + e (recent files)
instead of opening the Class in the same window by pressing Enter
you can open it in a new window using your own keyboard shortcut (Shift + Enter in my case).
Right-click on tab.
Select Move Tab to New Window option.

Shortcut to Close Intellij File Tab

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.
Open Settings by hitting Ctrl+Alt+S
Click: Keymap
Search for: Close
Under Main menu > Window > Editor Tabs, find Close.
Right-click and click Remove Ctrl+F4.
Right click and click Add Keyboard Shortcut
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.
For PC-based keyboards, the shortcut to close tabs is CTRL + F4,
not to be confused with ALT+F4.
Current tab can be closed with:
Ctrl + F4
Works on Intellij Ultimate 2016.3
On mac OS, Intellij 2018.3 version, 'Command + W' does close the file tab.
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.
I'm on version 2020.1 and this has changed to Ctrl+4

How to set single clicking to open file in IntelliJ IDEA?

And what are counterparts to eclipse's declaration view and javadoc view?
In the Project View click on the "gear" icon and enable the Open Files with Single Click option:
Use Ctrl+Q for Quick JavaDoc and Ctrl+Shift+I for the declaration pop-up.
Now it's available in a simpler way. In the Project View click on the Gear icon and then click Open Files with Single Click:
Go to Preferences and turn on Enable preview tab, that will enable Open Files with Single Click for all projects.
Javadoc opens with Ctrl+Q
There's no declaration view per se, however, you probably will be satisfied with Ctrl+Shift+I shortcut for quick lookup.
Don't know of any ways to configure it to open files on single clicks. Somehow, if you get used to the shortcuts, you skip using mouse very much. For instance, Alt+Home will bring the navigation bar up and you can move with arrows and open the file with Enter. Or just use some other shortcuts like Ctrl+N or Ctrl+E depending on the context.