vim 에서 substitute  할때 newline 문자를 입력하려면 \n 대신 \r 을 사용하면 된다.

 

%s/before/after\r/g

From vim docs on patterns:

\r matches <CR>

\n matches an end-of-line - When matching in a string instead of buffer text a literal newline character is matched.

Ref

 





blog comments powered by Disqus