Move lines in Vim
I'm trying to replicate TextMate's move selection command in Vim.
I've come up with this:map <C-D-Up> ddkP
map <C-D-Down> ddp
vmap <C-D-Up> dkP
vmap <C-D-Down> dp
Single lines work just as expected. But visual mode isn't perfect.
I want it to keep (or reselect) the selection in visual mode, so that I开发者_如何学JAVA can move the selection multiple times easily. I found gv
but that doesn't work, as it doesn't select the moved lines but something further down the document.
Any ideas?
精彩评论