srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2022-12-07 21:49:50 +0200
committersrdusr <[email protected]>2022-12-07 21:49:50 +0200
commita029d28872aef37c5192f32d46fb7d00da7e41a7 (patch)
tree6409dff463320b735f9412d17f4db5f9d7b03ae8 /tools
parent72e120f554e08a653b6228a04854b4fa8f78ddec (diff)
downloadnotes-a029d28872aef37c5192f32d46fb7d00da7e41a7.tar.gz
notes-a029d28872aef37c5192f32d46fb7d00da7e41a7.zip
Fixed formatting for search and replace commands
Diffstat (limited to 'tools')
-rw-r--r--tools/vim.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/vim.md b/tools/vim.md
index 601ecd5..720291e 100644
--- a/tools/vim.md
+++ b/tools/vim.md
@@ -33,7 +33,8 @@ or
:sb#
:vert sb#
-* Search and Replace, The :substitute command searches for a text pattern, and replaces it with a text string. There are many options, but these are what you probably want:
+* Search and Replace, The :substitute command searches for a text pattern, and replaces it with a text string. There are many options, but these are what you probably want:
+```
:s/foo/bar/g
# Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
:%s/foo/bar/g
@@ -48,14 +49,14 @@ or
# This may be wanted after using :set noignorecase to make searches case sensitive (the default).
:%s/foo/bar/gcI
# Change each 'foo' (case sensitive due to the I flag) to 'bar'; ask for confirmation.
-
+```
* Create a new file named filename in the same directory as the currently open file, and write it.
:e %:h/filename
* VIM KEYBOARD SHORTCUTS
-*** MOVEMENT
+* MOVEMENT
```
h - Move left
j - Move down