Question

Lets say that i have this block of text

public function __construct() {
    parent::__construct();
}

and i want to insert a new line above parrent::construct at the same level. Like:

public function __construct() {
    // this is the new line. 
    parent::__construct();
}

how can i do this. I try'ed to do Ctrl+Enter in command mode but that will move the { down also. I managed to do it by going with the cursor to beginning of parent and do Ctrl+Enter. Isn't there a way to do it when the cursor is at the end of the first line ? or a shortcut to jump faster to parrent ?

Was it helpful?

Solution

Try O and o in the normal mode.

OTHER TIPS

Maybe you should enable auto indention? That might solve your problems.

In your .vimrc file:

:set autoindent
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top