Search code examples
webstorm

How to insert a new line above current in Webstorm?


The equivalent behavior in Sublime Text and Visual Studio is "Shift+Control+Return." and I would like to figure out a solution.

Either I can not find this in the documentation or no such functionality exists within Webstorm.

I suspect that one could create a macro to do this, but I can not figure out how to get the cursor position correct after execution.

Has anyone else found a solution for this?


Solution

  • In the OSX edition of IntelliJ (just a beefed up version of WebStorm), there is a key binding called "Start New Line Before Current". I think this is what you want.

    Open up Settings -> Keymap -> Search for "line"

    For me, it's Alt+Cmd+Enter

    For you it might be Ctrl+Alt+Enter (instead of Cmd)

    enter image description here