/
vim 에서 치환할때 개행 문자(new-line character) 입력
vim 에서 치환할때 개행 문자(new-line character) 입력
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
- http://stackoverflow.com/questions/71323/how-to-replace-a-character-for-a-newline-in-vim
- http://vim.wikia.com/wiki/Search_and_replace