3 ms·
Created an account to post this: :v/./,/./-j in vim will go through the whole file, joining multiple consecutive empty lines into one. Not only it is fork-b
by urxvtcd 7y ago
Created an account to post this:
:v/./,/./-j
in vim will go through the whole file, joining multiple consecutive empty lines into one. Not only it is fork-bomb-level cryptic, but also showcases how you can use addresses to do advanced stuff.
Somewhat more readable version:
:vglobal /./ .,/./- join
which is: go to every line that doesn't match (vglobal) /./ (is empty) and join lines from that line (.) to the line before (-) the next line that is not empty (/./ again).