7

None of the suggestions found here work, nor does a search on issues in the repo turn up anything.

I'd like to replace all >< with >\r\n< inside a selection

'<,'>s/></?/g

what goes in place of the question mark?

Community
  • 1
  • 1
Maslow
  • 18,464
  • 20
  • 106
  • 193

2 Answers2

2

Does this work for you?

:'<,'>s/></>\r</g

Are you on windows and trying to insert both (literal) \r (carriage return) and \n (new line) ?

ffledgling
  • 11,502
  • 8
  • 47
  • 69
1

I just had success a moment ago moving asterisks to the start of a new line (i.e. replace asterisk chars with newline + asterisk) with:

:%s/\*/\r*/g

for clarity, that's:

:%s   (replace in whole file)
\*    (literal asterisk)
\r*   (new line followed by literal asterisk)
g     (operate on all matches on any given line)
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220