Move to the beginning of New Line - VIM

advertisements

while in insert mode in vim how do i move to a new line correctly indented.

In many editors this action would be CTRL+ENTER

There is a similar stackoverflow question here however this answer takes you back to the start of the current line SO start of current line

So assuming this is my code, my cursor is just at the T in POST and i want to go to the start of the next line or next line with correct indentation if its a function(using snippets for function so now great concern).

@app.route('/add', method=['POST | '])

expected result

@app.route('/add', method=['POST'])
|


I would use <esc>o. Assuming you have filetype plugin indent on in your vimrc o will automatically go to the correct indent level.