?txt (backward searching)
/\
Get rid of the highlighting after search:
:set nohlsearch
Enable highlighting searching:
:set hlsearch
Find the replace:
:s/word/replacement/ ( once )
:s/word/replacement/g ( all at once on a single line )
:.,.+Ns/word/replacement/g ( all at once on the current line and
the next N lines )
:%s/word/replacement/g ( all at once the whole text )
:s/word/replacement/cg ( you need confirm whether or not to
replace )
:s/word/replacement/gi ( case insensitive )
:set ic ( case insensitive )
:set noic ( case sensitive )
:%
ref: http://www.linux.ie/articles/tutorials/vi2.php
No comments:
Post a Comment