edit vim
This commit is contained in:
@@ -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/{&}
|
||||
|
||||
|
Reference in New Issue
Block a user