开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜