I usually have to worry about escaping search parameters to get special characters to match literally, but this time I'm seeing a problem with my replacement string.
I want to take text like this:
@@ something @@ should_be_on_another_line
And turn it into this:
@@ something @@
should_be_on_another_line
/ @@ /
matches the second @@
pair on each line just fine, but when I try this command:
:%s/ @@ / @@ \n/g
I actually end up with this:
@@ something @@^@ should_be_on_another_line
I tried escaping the @@ \n
in the replacement as \@\@ \n
, but that didn't help (same results).