Xiaobo Sun

Eclipse-Unix http://umlfact.berlios.de/~s_xsun/

Vi: Search and Replace

Vi: Search and Replace

Change to normal mode with <ESC>.

Search (Wraped around at end of file):

Search STRING forward : / STRING.

Search STRING backward: ? STRING.

Repeat search: n

Repeat search in opposite direction: N (SHIFT-n

Replace: Same as with sed, Replace OLD with NEW:

First occurrence on current line: :s/OLD/NEW

Globally (all) on current line: :s/OLD/NEW/g

Between two lines #,#: :#,#s/OLD/NEW/g

Every occurrence in file: :%s/OLD/NEW/g 



posted on 2008-11-06 17:18 Xiaobo Sun 阅读(1043) 评论(0)  编辑  收藏 所属分类: Unix tools


只有注册用户登录后才能发表评论。


网站导航:
 
<2008年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

导航

统计

常用链接

留言簿(3)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜