Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to do a mapping that moves the current line to another line. Something like

nnoremap < space >m$VARIABLE :m $VARIABLE <CR> dd
share|improve this question

Start with the basics, typing:


Would move the CURRENT line ('.') to line 15.

Other than possibly creating a user-command which would accept a leading number indicating WHERE you want the current line to be moved, nothing comes to mind, nothing SIMPLE comes to mind. (Rube Goldberg comes to mind...)

command! -nargs=0 MyMove :.m<count>
nnoremap! mv :MyMove

MIGHT work, my vim-fu is not strong yet. You didn't supply much information, but that's close I suppose.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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