Re:A Starting Guide to VIM from Textmate
by silentbicycle on Saturday November 20, 2010 @12:37PM
(#1924854)
You're absolutely right (and sort's options are rather quirky), just trying to nudge people to thinking about piping through shell commands that way. There's a lot of power in the ex parts of vi (the : commands) that I seldom hear vi(m) users mention.
Being able to pipe through commands is a powerful tool, but using an example where the external command already has a built-in equivalent seems possibly confusing to the (novice Vim'er) reader (please don't rattle me off the laundry list of options that /usr/bin/sort has that :sort doesn't because you'd be missing the point).
That said... On the topic of ranges, never give :bd! a range unless you know what you're doing. I ran :bd! once while I had a number of lines selected in visual mode because I though that the selected lines wouldn't affect :bd. Bad idea. The '<,>' part of the range apparently is converted to line numbers (e.g. '3,6') and then :bd reads that range as the buffers to delete. So when you select lines 1-8 and then hit :bd! it goes something like this:
Oops!