JavaRocky
JavaRocky

Reputation: 19893

Intellij New line on current line shortcut

Is there a keyboard shortcut to start a new line on the currently selected line?

I.e. The current line goes down one line and the cursor is on a blank line.

There is Shift + Enter which starts a new line but on the next line. I want the current line.

Upvotes: 23

Views: 12916

Answers (5)

Bjorn
Bjorn

Reputation: 71810

On mac this works for me:

+ +

Upvotes: 22

Bryan Rink
Bryan Rink

Reputation: 609

CTRL+ALT+ENTER was the right shortcut for me (version 12.1.6).

Upvotes: 27

Ben
Ben

Reputation: 16524

CTRL+SHIFT+ENTER works as of 11.2.

Upvotes: 24

Hugo Palma
Hugo Palma

Reputation: 3566

There isn't one, but you can very easily create it using a macro. In order to create the macro you can follow these steps:

  1. Place the cursor on any line with code.
  2. Click on menu Tools | Start Macro Recording
  3. Press: Home -> Enter -> Up
  4. Click on menu Tools | Stop Macro Recording
  5. Test your macro using Tools | Playback Last Macro
  6. You can remove any action from the macro that doesn't belong there by using Tools | Edit Macros.
  7. When the macro is working fine you can assign a shortcut to it in the Settings window on the Keymap page.

Upvotes: 3

JavaRocky
JavaRocky

Reputation: 19893

Do not think anything exists in version IntelliJ 8 or 9 for that matter. Prove me wrong.

Upvotes: -2

Related Questions