I tried to bind the following to insert a line after the line I'm currently on. Here it is:nnoremap <CR> o<ESC>kBut this works weird. After inserting a new line cursor is at the beginning of the line I was on. Is there a way to insert a new line in normal mode and stay at the same position?
How to insert line in normal mode and stay at the same position
key bindings;vimrc
That's odd, I was quite sure to have already answered this question twice. It may have been on SO...Anyway. Use append(). It won't move the cursor or alter more registers than necessary. This also supports counts. Try 3<cr>:nnoremap <buffer> <cr> :<C-U>call append('.', repeat([''],v:count1))<cr>