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

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.

Your Answer

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

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