This commit is contained in:
2023-04-16 14:49:47 +02:00
parent 7e4ac7c7b1
commit 317dbb6a5a
3 changed files with 20 additions and 8 deletions

View File

@@ -2,6 +2,8 @@
title: "vim search"
tags: [ "Documentation", "vim" ]
---
Search for the next and or previous occurrence of the word under your cursor with `*` and `#`.
Search and replace the first 'one' found with 'two':
> :%s/one/two/
@@ -10,3 +12,11 @@ Same, but replace 'one' globally:
> :%s/one/two/g
Put quotes around every occurrence of `$HOME`:
> :%s/$HOME/"&"
Same, but add curly brackets around `$HOSTNAME`:
> :%s/$HOSTNAME/{&}