Created
October 13, 2011 21:45
-
-
Save thisivan/1285626 to your computer and use it in GitHub Desktop.
This file contains 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
vmap <Leader>! :call ExecuteVLines()<CR> | |
function! NumSort(a, b) | |
return a:a>a:b ? 1 : a:a==a:b ? 0 : -1 | |
endfunction | |
function! ExecuteVLines() | |
let [firstline, lastline]=sort([line('v'), line('.')], 'NumSort') | |
let lines = getline(firstline, lastline) | |
exec ":!".join(lines, " && ") | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment