Created
September 26, 2012 14:23
-
-
Save tacahiroy/3788349 to your computer and use it in GitHub Desktop.
move up/down visualed lines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! s:move_block(d) range | |
| let cnt = a:lastline - a:firstline | |
| if a:d ==# 'u' | |
| let sign = '-' | |
| let cnt = 2 | |
| else | |
| let sign = '+' | |
| let cnt += 1 | |
| endif | |
| execute printf('%d,%dmove%s%d', a:firstline, a:lastline, sign, cnt) | |
| endfunction | |
| vnoremap <Down> :call <SID>move_block('d')<Cr>==gv | |
| vnoremap <Up> :call <SID>move_block('u')<Cr>==gv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment