Jump to editor shortcut in Intellij IDEA

Intellij IdeaKeyboard Shortcuts

Intellij Idea Problem Overview


I can use F12 to jump to project tree (if it was the last tool that I used), but is there a shortcut for jumping back to editor?

Intellij Idea Solutions


Solution 1 - Intellij Idea

Esc usually brings the focus back to the editor.

Solution 2 - Intellij Idea

With Alt + Home you can actually put focus on selecting the file and hit enter in order to go to the editor.

Esc is not always going to put the focus on editor.

For those on Mac (you don't have a Home key), use Command + E to open the recent files then hit enter.

Solution 3 - Intellij Idea

Pressing F4 (Jump to Source action) in a selected resource in the Project View opens the editor with focus.

Solution 4 - Intellij Idea

Another easy way to get from Terminal to Editor (on Mac) with two keys that are close together: Press āŒ˜1 to go to the project tool window, then hit Esc.

Solution 5 - Intellij Idea

You can use ctrl + tab Navigate between files opened in the editor, and tool windows.

Sample

Solution 6 - Intellij Idea

This is definitely a workaround, but, on mac os the following keystrokes work,

[ SHIFT + CMD + A ] > type "edit" > [ ENTER ]

So, I created a Service using Automator as follows,

  • receives no input
  • active for my IDE only ( phpstorm )
  • runs an AppleScript ( see below )

Then I mapped the Service via "System Preferences > Keyboard > Shortcuts > Services" to

[ CTRL + OPTION + CMD + i ]

The Automator Service, contains the following AppleScript,

on run {input, parameters}
    tell application "System Events"

        keystroke "A" using {shift down, command down}
        
        delay 0.2
        keystroke "edit"
        
        delay 0.2
        keystroke return

    end tell
    
    return input
end run

Solution 7 - Intellij Idea

There is no perfect solution, since Escape doesn't work if your other Tool Window is a Terminal, Windowed... as a result there is an open ticket on Jetbrains, bug tracking site see this link.

Also, if you have "Autoscroll to Source" disabled (default state in Intellij):

  • Escape puts cursor in file currently visible in editor (As mentioned in the other Answers)
  • F4 puts cursor in file currently selected in the Project view.

Solution 8 - Intellij Idea

The most elegant way found in mac: ctrl + tab + p

ctrl + tab: open recent file, always last file opened
ctrl + p: last line in mac default keymap

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
QuestionFlashrunnerView Question on Stackoverflow
Solution 1 - Intellij IdeaCrazyCoderView Answer on Stackoverflow
Solution 2 - Intellij IdeaM.RezView Answer on Stackoverflow
Solution 3 - Intellij IdeaMarcos VasconcelosView Answer on Stackoverflow
Solution 4 - Intellij IdeaRusty Brown NailView Answer on Stackoverflow
Solution 5 - Intellij Ideasendon1982View Answer on Stackoverflow
Solution 6 - Intellij IdeasearaigView Answer on Stackoverflow
Solution 7 - Intellij IdeapawelView Answer on Stackoverflow
Solution 8 - Intellij IdealiaomingView Answer on Stackoverflow