VIM replacement operation

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Often use:%s/oldstring/newstring/g and VIM:%s/oldstring/newstring/gc will replace oldstring in newString.

Today in the labeled samples, search the replace operation more about VIM, as follows:

1,:%s/oldstring/newstring/ Replace the first appeared all rows in the oldstring   /gc is to choose whether or not to replace;

2,:%s/oldstring/newstring/G replaced oldstring   all line; /gc.

3,:n,$s/oldstring/newstring/g  Replace all oldstring   n from the start line to the last row; ($represents the last line, can be m, said the N line to line M)

4,:.,$s/oldstring/newstring/G replaces all oldstring from the start to the last row

5,:s#oldstring/#newstring/#Replace oldstring/ with newString/

Today is the entry for 1 years, no matter how bad the past, every day I will seriously, treat time.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Caroline at November 13, 2013 - 12:25 PM