here is the regex: %s/)\s*\n\s*{\n/) {\n/ig

It runs through but my code is getting formatted like this now

if(asdf) { ^@ nextline_of_code _newline_


Vim uses various represenations at different points for nulls and for newlines. Just change the "\n" in your replacement portion to "\r", making it

        %s/)\s*\n\s*{\n/) {\r/ig

and you should get the expected results.

-tim



Reply via email to