代码改变世界

Vim 使用

2024-01-10 20:23  john_zhu_t  阅读(22)  评论(0)    收藏  举报
  1. '\r' (0x0d) 替换为'\n' (0x0a)
    :%s#^M#\r#g
    其中^M 通过按键 ctrl+v+m所得(编辑模式和命令模式)
    :%s#^M#\n#g
    只会将'\r'(0x0d)替换为'^@'(0x00)
  • When searching: \n is newline, \r is CR (carriage return = Ctrl-M = ^M)
  • When replacing: \r is newline, \n is a null byte (0x00).
    请参考