On Saturday, 17 November, 2012 at 14:31:23 GMT, cyboman wrote:
I have a - key mapped to move the line down. Here it is
map - ddp

I want to have a command opposite to it, _ to move the line up.
I tried map _ ddkP but it doesn't work. If I'm on the last line of text it will 
move the text two lines up and if I'm on the first line it simply deletes the 
lines, which makes sense why.

I know this is a simple task for most of you, but I have never fiddled with Vim 
mappings. I would appreciate if anyone could help me out.

Try fiddling with searching the list. If you had read a recent thread titled 
“move a range of text to address”, you'd see that this is [probably] the 
preferred solution:

nnoremap _ :m-2<cr>
nnoremap - :m+<cr>

--

.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to