Prasad Chalasani
Prasad Chalasani

Reputation: 20282

Intellij IDEA: shortcut to switch between code and Scala console (Mac)?

One of the most frequent things I used to do in Emacs is to have two buffers open: one for Scala code, and one for the Scala Console/REPL, and send code from the code buffer to the console, and rapidly switch between the two buffers using my own defined keyboard shortcuts.

What are the keyboard short-cuts to do this in Intellij IDEA with Scala? None of the docs seem to have exactly what I want, which is:

  1. have both the Scala console (REPL) and the file (code) windows open
  2. switch back and forth between code and console.

If there's no pre-defined keyboard shortcut, then is there an action for this, so I can define my own shortcut? I know there's "Jump to last window" (F12) and "Restore default layout" (Shift F12); these almost get me what I want: F12 takes me to the Scala console, and Shift F12 takes me to the code but closes the Scala console, and I want the Scala console to remain open.

More generally, it would be great to have Shortcuts/Actions to simply cycle through the open windows/components in the IDE, without having to use the switcher (Ctrl-TAB).

Upvotes: 1

Views: 1039

Answers (1)

Nate
Nate

Reputation: 2205

As far as I can tell you can run the scala console in either Run mode or Debug mode.

  • To jump to the Run panel you can hit: Cmd + 4
  • To jump to the Debug panel you can hit: Cmd + 5
  • To jump to code without closing the panel hit ESC
  • To close the currently open panel and go back to code hit the same shortcut for the panel.

If for some reason these don't work for you you can check the keymap bindings. Run & Debug bindings are under Main menu -> View -> Tool Windows -> Run, Debug. The escape binding is Editor Actions -> Escape.

Upvotes: 3

Related Questions