Vim can run shell commands as filters over selections as well.
Although vim does provide its own `:sort`, you can also sort the current selection like
v{motion}!sort
Which uses the external sort command (coreutils)For reversing,
v{motion}!tac
Which uses `tac` to reverse the order of the lines.This general concept is quite useful in many other ways, since it is quite universal - selection goes to stdin of arbitrary program, stdout of that program replaces selection.
For example, if you want to quickly test a function that takes a json string, and you're in a language where instantiating good mock objects and serialising it takes quite a bit of code, you can quickly make a mock by writing JS code within the string quotes and have the code console.log json and then `vi'!node` will replace it there.