benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
396 stars 28 forks source link

C-j should insert a literal newline in the regex #13

Closed Wilfred closed 10 years ago

Wilfred commented 10 years ago

Currently, after calling vr/replace, pressing C-j just prompt me for a replacement. I was expecting it to give me a literal newline. I can't see any way of writing regexes with newlines currently.

benma commented 10 years ago

This is consistent with how Emacs' builtin replace-regexp works. The usual recommendation is to use C-q C-j to enter a newline.

Also note that when using the Python engine in visual-regexp-steroids, you can enter a newline by typing "\n".

Wilfred commented 10 years ago

Ah, of course. Would you mind adding a note (perhaps in the readme) to point this out?

benma commented 10 years ago

I do not think this is the place to document that, as it has nothing to do with visual-regexp, but with general Emacs usage. It would be arbitrary to pick this out of many things to document here.