浏览代码

vim: simplify substitution in whole file (#1555)

Starbeamrainbowlabs 7 年之前
父节点
当前提交
83f4361136
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pages/common/vim.md

+ 2 - 2
pages/common/vim.md

@@ -23,9 +23,9 @@
 
 
 `<Esc>/{{search_pattern}}<Enter>`
 `<Esc>/{{search_pattern}}<Enter>`
 
 
-- Perform a regex substitution in the whole file (from the start, `1`, to the end, `$`):
+- Perform a regex substitution in the whole file:
 
 
-`<Esc>:1,$s/{{pattern}}/{{replacement}}/g<Enter>`
+`<Esc>:%s/{{pattern}}/{{replacement}}/g<Enter>`
 
 
 - Save (write) the file, and quit:
 - Save (write) the file, and quit: