3 ms·
gq for reflowing. The main problem I have is when I'm authoring in vim and pasting to another editor which interprets hard returns as, well, hard returns. Mos
by dredmorbius 13y ago
gq for reflowing.
The main problem I have is when I'm authoring in vim and pasting to another editor which interprets hard returns as, well, hard returns.
Mostly I play games with piping through a formatting tool or join up lines manually before pasting them. Hrm. Now you've got me wondering if there's a good way to do that generically.
- dredmorbius 13y agoAnd here's what I've come up with, as ~/bin/unwrap: #!/usr/bin/perl -p use strict; BEGIN{$/=undef;} { s/(?<!\n)\n(?!\n)//sg; } END {print"\n"}