I want to use a shell command (
fmt in this case) to operate on every (non-)matching line of a regex in a file. I'd prefer to do it within
vim! I am, nonetheless, open for a pure shell/bash/zsh solution too, since vim offers
:! as well.
Is it possible to combine
with a shell command that is executed on matching lines? Something like
:g/pattern/!fmt -w 72
is not working.