3 ms·
Are you doing the formatting via a Vim plugin? I often find it's much faster to pipe out to a command line program to do formatting on huge files. e.g. :%
by _djo_ 6y ago
Are you doing the formatting via a Vim plugin?
I often find it's much faster to pipe out to a command line program to do formatting on huge files.
e.g.
:%! jq
or
:%! xmllint --format -
- OJFord 6y agoHuh, thanks, I didn't know you could put the contents on stdin like that (%!) - just in case you (or anyone) was similarly unaware in reverse, you can also put `%` wherever you want to use the filename in the command. i.e. I would have done: :! jq % and have probably been guilty of (not knowing `%!` per above): :! cat % | ...