Vim Find and Replace

To search for the first occurrence of the string 'Hello' in the current line and replace it with 'Hi' :

:s/Hello/Hi/

To replace all occurrences of the search pattern in the current line, add the g flag:

:s/Hello/Hi/g

To replace all occurrences of the search pattern in the entire file, add the percentage character % :

:%s/Hello/Hi/g

To ignore case sensitive, use the i flag:

:%s/Hello/hi/gi