10 years ago
Rebinds J and K in visual mode to move block up or down in relation to the other lines, while keeping the selection.
This version also re-indents the line to match indentation rules in its new position. (if you don't like that, remove the 'gv=' in the middle :D)
" Move visual block vnoremap J :m '>+1<CR>gv=gv vnoremap K :m '<-2<CR>gv=gv
mesrine 10 years ago
/sign
craigp 9 years ago
This is an epic tip
Jay 9 years ago
I <3 you. (in the straightest way possible)
Ahmed El Moden 7 years ago
There is a plugin for this https://github.com/matze/vim-move
Sævar Berg 10 years ago
This is friggin' awesome!