Vim操作

Posted by xionghongzhi on October 23, 2017
  1. 关于Vim的替换操作

    Replace All:

    :%s/foo/bar/g Find each occurrence of ‘foo’ (in all lines), and replace it with ‘bar’.

    For specific lines:

    :6,10s/foo/bar/g Change each ‘foo’ to ‘bar’ for all lines from line 6 to line 10 inclusive.