One-liner to sort clipboard
some.gonze.com
some.gonze.com
But if you're in a high-octane development environment like vi, there's no need to resort to a separate terminal window to invoke 'sort clipboard'. just mark a range of lines (v) then :!sort to filter through good old unix sort.
#!/bin/sh
# save as xfilt
xsel -ob | "$@" | xsel -ib
so, for instance, get a bit of json in your clipboard http://json.org/example.html and run xfilt jq .glossary.title. Now your clipboard contains "example glossary" instead of the whole json file.One wrinkle is, if you get your filter wrong, you have to return to the original source to copy again, because the operation is destructive each time...
1. You're in an edit field in any old app - browser, Atom, vi
2. Select lines to sort and ^c
3. alt+tab to command line
4. pbsort
5. alt+tab back to app
6. ^v