Skip to content

Instantly share code, notes, and snippets.

@thisivan
Created October 13, 2011 21:45
Show Gist options
  • Save thisivan/1285626 to your computer and use it in GitHub Desktop.
Save thisivan/1285626 to your computer and use it in GitHub Desktop.
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