Replacing \n
In vim, you can replace \n with a newline by running :s/\\n/\r.
In ex-mode, you have to use :s/\\\\n/\n.
I'm not sure whether we should follow vim in the replacement patterns (\n = NUL, \r = NL), but using \\\\n to match \n isn't right.
+1
I just encountered that bug when trying to replace a LaTeX-command. I had to search for \\\\mycommand instead of \\mycommand.
It might be that this is because the substitute-function calls the replace-routine for all matches (line 352 in ex.coffee ), but replace/replaceGroups checks for the regex-match, too, so the expression is double-checked. But I've never written any coffee-script and it is more a guess than the result of a professional code review, so I might be wrong about it...