From 68a99bbe7f110146011bf3edb946a06674bd3167 Mon Sep 17 00:00:00 2001 From: I-Man Ng Date: Thu, 9 May 2019 15:11:41 +0800 Subject: [PATCH] improve caret substitution adding global replace --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb0fc71..7f6d1cd 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Esc + c ```bash !! ``` -##### Run last command and change some parameter (e.g. last command: echo 'aaa' -> rerun as: echo 'bbb') +##### Run last command and change some parameter using caret substitution (e.g. last command: echo 'aaa' -> rerun as: echo 'bbb') ```bash #last command: echo 'aaa' ^aaa^bbb @@ -73,6 +73,11 @@ Esc + c #echo 'bbb' #bbb +#Notice that only the first aaa will be replaced, if you want to replace all 'aaa', use ':&' to repeat it: +^aaa^bbb^:& +or +!!:gs/aaa/bbb/ + ``` ##### Run past command that began with (e.g. cat filename)