What I tend to use more often than :%! is to actually highlight a number of lines using V (visual line) and then apply an operation by simply typing : and then ! (vim automatically inserts the range specifier '<,'> for you), followed by your command. I typically do this with sort to arrange import sections in particular.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
What I tend to use more often than
:%!
is to actually highlight a number of lines usingV
(visual line) and then apply an operation by simply typing:
and then!
(vim automatically inserts the range specifier'<,'>
for you), followed by your command. I typically do this withsort
to arrange import sections in particular.Yup - me too. And a quick look at
:h !
will show you how to pass through motions and line ranges to an external program.The possibilities are ... well, not endless. But there are a lot of them.
If you enjoy doing this sort of thing, you should really take Acme out for a spin.
Saying "the possibilities are finite!" is more accurate but less fun.