3 ms·
Huh, never heard of `!G`. How is it different from `%!sort`?
by feanaro 5y ago
Huh, never heard of `!G`. How is it different from `%!sort`?
- nerdponx 5y ago! is also a normal mode command/operator. It accepts a motion and then drops you into the command line with :{range}! pre-filled, where {range} is the range of lines covered by the motion. !G in normal mode is exactly equivalent to :.,$!
- feanaro 4y agoOh, wow! That's so neat. Thank you for explaining. It's curious that I missed this for so long.
- nerdponx 4y agoIt's OK, I've been a "serious" Vim user for ~7 years and I just learned about it this year. It's such an enormous program with so much functionality that is hard to fault somebody for missing any individual piece of it. What I find weird is that there's no analogous normal mode operator command for dropping into a command line without the ! prefix. It's easy enough to write your own (good excuse to learn about "operator pending mode"), but I often find myself scratching my head at what made it into the builtin commands and what did not.