Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer 1

Start with the basics, typing:

:.m15

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

 
discard

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.