News for hackers. Stuff that matters.
Re:Why Atom Can’t Replace Vim – Learning the lesson of vi by vram22 on Sunday June 01, 2014 @07:08AM (#7828795)
A nice use of the ! command in vim, is if you have a text files with lines and you want to sort it; do this, in command mode:

!Gsort

The ! command can also sort just a range of lines (in place, in the file), which can be even more useful. The range can be selected either by start and end line numbers, as in the parent comment's 2nd example, or by start and end marks (set by ma, mc, etc.) or even by a combination of the two, e.g. starting line number, end mark:

:'a,'b!sort :123,'b!sort

Another example - turn a list of constant definitions in your code, into uppercase:

!Gtr [a-z] [A-Z]

And so on ...

Re:Why Atom Can’t Replace Vim – Learning the lesson of vi by vram22 on Sunday June 01, 2014 @07:34AM (#7828838)
Edit 2: Also, vim has a built-in sort command:

http://vim.wikia.com/wiki/Sort_lines

, so for the sort example I gave, too, you may not need to shell out to the external sort command. On the other hand, you may want to, since it has more functionality.

Plus, vim doesn't have every filter command that Unix does, so the ! command is still very useful.

Re:Why Atom Can’t Replace Vim – Learning the lesson of vi by vram22 on Sunday June 01, 2014 @07:28AM (#7828827)
Edit: After reading the OP, I realized that my example of uppercasing constant definitions, can be simpler with this vim command, which doesn't shell out to the tr command:

gUG

(uppercase U in the command, as opposed to the OP's use of guG - lowercase u).

Re:Why Atom Can’t Replace Vim – Learning the lesson of vi by csirac2 on Sunday June 01, 2014 @07:48AM (#7828860)
Gsort is cool! I usually defer to my blunt instrument approach of just doing ! sort. Vim is one of the few tools that keeps rewarding me more and more, the longer I use it.
Re:Why Atom Can’t Replace Vim – Learning the lesson of vi by vram22 on Sunday June 01, 2014 @09:32AM (#7829084)
>Vim is one of the few tools that keeps rewarding me more and more, the longer I use it.

True :-)