Find & replace newlines or whitespace with Vim
If you're looking to collapse lines via a find/replace in Vim, you probably need to kill both whitespace and newlines. Use \_s
to match against both. Here's the situation where I just now made use of this:
%dt
%label Name
To remove the %label
here, select the range in visual mode, type s/\_s*%label//g
, and you'll get:
%dt Name
Tweet