svermeulen / vim-subversive

Vim plugin providing operator motions to quickly replace text
MIT License
295 stars 4 forks source link

Substituting with newline (`\r`) #27

Open fasterius opened 1 year ago

fasterius commented 1 year ago

Thanks for the awesome plugin! I just recently came across it, but I'm loving it so far! I have a problem, though: I need to do some substitutions with newlines recently, but it didn't work.

With the standard mappings as described in the documentation I can e.g. visually select something I want to replace with newline (, was what I was working on at the moment), followed by <leader>sip to replace inside the current paragraph. This gives me the prompt and I can type \r. This replace with the text \r rather than a newline.

If I do the equivalent in vanilla vim (visual selection + :s/, /\r/g) it works just fine and newlines are correctly inserted.

Should I be typing something other than \r to insert newlines, or am I missing something stupid?