Vi Editor - Linux
Vi Editor - Linux
Vi Editor - Linux
1
Searching for a String Substituting One String for Another
The Search Commands
/xxx - search forward for text string xxx [address]s/search-string/replace-string[/g]
?xxx - search backward for text string xxx address
/ - repeat search forwards
? - repeat search backwards number - line number
n - repeat search in same direction 77,100 - line 77 through 100
N - repeat search in opposite direction
1, . - the beginning of the work buffer through the current line
Special Characters in Search Strings
^ - the beginning-of-line indicator .,$ - the current line through the end of work buffer
$ - the end-of-line indicator 1,$ - the entire work buffer
. - the any character indicator
\> - the end-of-word indicator % - the entire work buffer
\< - the beginning-of-word indicator .,.+10 - the current line through the tenth following line
[ ] - the character class definition
2
Setting Parameters Units of Measure
Parameters (Cont.) Character
Shell[=pathname]
showmode, noshowmode - give a cue to let you know when vi is in Word - <space>, <tab>,<newline>, numeral, punctuation
Input Mode marks
flash, noflash - beep when give invalid command or press <ESC> in
Command Mode Line - <newline>
ignorecase, noignorecase - ignore case in search Sentence - period, exclamation point, question mark,
magic, nomagic - special characters in search strings have no special
meanings (except ^, $) followed by two <space> or a <newline>
list, nolist - show <TAB> -> ^I, end of line -> $ Paragraph - blank line
wrapscan, nowrapscan
autoindent, noautoindent Screen
shiftwidth=nn