vim replace character to \n

guilin 桂林 picture guilin 桂林 · Oct 19, 2010 · Viewed 8k times · Source

I need replace all ; to \n , but :%s/;/\n/gc not works

Answer

Eugene Yarmash picture Eugene Yarmash · Oct 19, 2010

See http://vim.wikia.com/wiki/Search_and_replace

When searching: \n is newline, \r is CR (carriage return = Ctrl-M = ^M)
When replacing: \r is newline, \n is a null byte (0x00).