If ddkP is typed in normal mode on the first line then nothing happens¹. If :nnoremap + ddkP is executed and then + is pressed, the line is deleted. Why?

¹(if file only has one line then a new empty line appears but otherwise the behaviour is the same)


Mappings abort on errors, and trying to move further « up » than the first line is an error, so the P never gets executed.

I have some other « bubble » mappings you might be interested in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy