update vim syntax

This commit is contained in:
2025-03-26 14:07:27 +01:00
parent a6b8420c26
commit 641b8fb825
6 changed files with 37 additions and 49 deletions

View File

@@ -1,22 +1,22 @@
---
title: "vim search"
tags: [ "vim" ]
tags: [ "vim", "search" ]
---
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/
`:%s/one/two/`
Same, but replace 'one' globally:
> :%s/one/two/g
`:%s/one/two/g`
Put quotes around every occurrence of `$HOME`:
> :%s/$HOME/"&"
`:%s/$HOME/"&"`
Same, but add curly brackets around `$HOSTNAME`:
> :%s/$HOSTNAME/{&}
`:%s/$HOSTNAME/{&}`