From 37fa82919bd815a5602d3d604ab8e141deac12f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Thu, 19 Oct 2017 14:38:46 +0200 Subject: [PATCH] vim: simplify substitution in whole file --- pages/common/vim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/vim.md b/pages/common/vim.md index ba1d4f445..f8846af4b 100644 --- a/pages/common/vim.md +++ b/pages/common/vim.md @@ -23,9 +23,9 @@ `/{{search_pattern}}` -- Perform a regex substitution in the whole file (from the start, `1`, to the end, `$`): +- Perform a regex substitution in the whole file (from the start to the end(% holds the file name)): -`:1,$s/{{pattern}}/{{replacement}}/g` +`:%/{{pattern}}/{{replacement}}/g` - Save (write) the file, and quit: