ChatGPT解决这个技术问题 Extra ChatGPT

Jump to editor shortcut in Intellij IDEA

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?

If you're using ESC for something else (e.g. vim), upvoting this will help the situation: Upvoting this should help: youtrack.jetbrains.com/issue/IDEA-116865
Suggest you alt+1 for that, nearer from your fingers positions
I actually looking for that F12 thank you!

E
ESV

Esc usually brings the focus back to the editor.


Ah, too bad. Thanks for your fast reply!
Thank you! I can't believe how hard I had to look for that information :)
Hi! That doesn't seem to work with terminal, sadly. Know of any workaround ?
Exactly what @Ven said. Some tool windows only respond to Shift-Escape, which works but hides the tool window.
There are a few workarounds for terminal. See this answer: stackoverflow.com/a/23860667/722929
d
dvorak4tzx

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.


I'll make useful extensive usage of this one here!! Thanks
d
davidxxx

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


This is really annoying that I had to add Enter key as a second shortcut (alongside with F4) to open and focus file from Project view
Best workaround for me because it doesn't hide any other window. Thanks.
R
Rusty Brown Nail

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.


Or simply press ⌘1 twice; much easier :)
s
sendon1982

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

https://i.stack.imgur.com/2JBgX.png


s
searaig

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

I didn't know this was possible, thanks for posting this answer!
great answer here - i'll use this as a template for other commands as well
Thank you. Shift+Cmd+A followed by Esc also seems to work.
T
Tshilidzi Mudau

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.


l
liaoming

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