I'd like to prepend the line below the current line to the current line. In other words, I want to "join" (like with J in normal mode) but instead of putting the line below the current line at the end of the current line, I'd like to put it at the front of the current line.


▋lorem ipsum amet dolor
blue green orange yellow


▋blue green orange yellow lorem ipsum amet dolor

with the position of the cursor--shown by the solid, black rectangle--at the beginning of the prepended snippet or at its end.

2 Answers 2


If you don't want to use any register, you can do

:+m- | normal J

or use mapping

:nnoremap <leader>J :<c-u>+m-<cr>J

:+m- is to move the next line to be after the previous line, so eventually the order of the two lines are exchanged.

  • 1
    Clever use of the rather obscure :move command! This solution doesn't clobber the default register like DJMcMayhem's. Commented Nov 9, 2018 at 7:19
  • Using :+m- to replace ddpk has one more benefit: it can be undone using a single u. But it cannot be repeated using . (ddpk cannot be repeated using . either)
    – doraemon
    Commented Nov 9, 2018 at 7:38

Just swap the lines before you join them:


Of course, if you would like to override J's behavior, you could map this with:

:nnoremap J ddpkJ

or if you want a new mapping so that you have both options:

:nnoremap <leader>J ddpkJ

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.