Vim note

1.  :g/pattern/s/old/new

The first g tells the command to operate on all lines of a file. pattern identifies the lines
on which a substitution is to take place. On those lines containing pattern, ex is to
substitute (s) for old the characters

old could be regular expression


2.  :%s/old/new/g

% indentifies all lines

s substitudes command

"old" could be regular expression


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章