(Vim) Replace / replace with newlines
- Replace newlines to XX:
:%s/\n/XX/- Replace the above
%with a range to apply the replacements only to a specific range
- Replace the above
- Replace XX with newlines:
:%s/XX/\r/- Replace the above
%with a range to apply the replacements only to a specific range - Note the use of
\rinstead of\nthis time
- Replace the above
Reference:
Written on February 25, 2021
