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 1/3] 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: From c4a0fbd89ef6f1058d8bfebd64e2830ff77233a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Thu, 19 Oct 2017 19:27:18 +0200 Subject: [PATCH 2/3] vim: add s for substitution --- pages/common/vim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/vim.md b/pages/common/vim.md index f8846af4b..7d826594d 100644 --- a/pages/common/vim.md +++ b/pages/common/vim.md @@ -25,7 +25,7 @@ - Perform a regex substitution in the whole file (from the start to the end(% holds the file name)): -`:%/{{pattern}}/{{replacement}}/g` +`:%s/{{pattern}}/{{replacement}}/g` - Save (write) the file, and quit: From 666f312e2bff870a2a0cf83226f197450bae17bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Sat, 21 Oct 2017 22:01:49 +0200 Subject: [PATCH 3/3] vim: remove wrongly description of % --- pages/common/vim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/vim.md b/pages/common/vim.md index 7d826594d..9ca4c24aa 100644 --- a/pages/common/vim.md +++ b/pages/common/vim.md @@ -23,7 +23,7 @@ `/{{search_pattern}}` -- Perform a regex substitution in the whole file (from the start to the end(% holds the file name)): +- Perform a regex substitution in the whole file: `:%s/{{pattern}}/{{replacement}}/g`