Some basic and advanced operations on Vim can be found in the links below.
Http://coolshell.cn/articles/5426.html
When using Vim to edit text, it involves bulk substitution of text content
: s/vivian/sky/replaces the current line the first Vivian is sky
: S/vivian/sky/g replaces the current line all Vivian are sky
: N, $s/vivian/sky/replaces the first Vivian of each row in the nth row to the last row is sky
: N, $s/vivian/sky/g replace the nth line to the last row all Vivian are sky
N is a number, if N is., indicating the beginning of the current line to the last row
:%s/vivian/sky/(equivalent to: g/vivian/s//sky/) replaces the first Vivian of each line as Sky
:%s/vivian/sky/g (equivalent to: g/vivian/s//sky/g) replaces all Vivian in each row as Sky
You can use # as a delimiter, at which time the middle/not as a delimiter
: s#vivian/#sky/# Replace the current row the first vivian/is sky/
:%s+/oradata/apras/+/user01/apras1+ (use + to replace/):/oradata/apras/Replace with/user01/apras1/
1.:s/vivian/sky/Replace the current line the first Vivian is sky
: S/vivian/sky/g replaces the current line all Vivian are sky
2.: N, $s/vivian/sky/the first Vivian of each row in the beginning of line N to the last row is sky
: N, $s/vivian/sky/g replace the nth line to the last row all Vivian are sky
(n is a number, if N is., representing the beginning of the current line to the last row)
3.:%s/vivian/sky/(equivalent to: g/vivian/s//sky/) replaces the first Vivian of each line as Sky
:%s/vivian/sky/g (equivalent to: g/vivian/s//sky/g) replaces all Vivian in each row as Sky
4. You can use # as a delimiter, at which time the middle appears/does not act as a delimiter
: s#vivian/#sky/# Replace the current row the first vivian/is sky/
Advanced operations and text replacement commands under VIM