Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vi editor find command 1

Status
Not open for further replies.

teser

Technical User
Mar 6, 2001
194
US

How do you find a word when you are in [tt] vi [/tt] editor.

For example if I want to find a specific word that is in my script. How would I do that?
 
1) Hit esc to get to the command mode:
2) To search forward from your current position
-Type "/" and type in your word and hit enter
3) To search backward
-Type "?" and type in your word and hit enter
4) If you'd like to go to the next occurance forward, just hit "n" or "N" to go backward to the previous.

-Tyler
 
If you need to search disregarding case, you may want to do a

:set ignorecase

first. If you always want that or other options, you can stick 'em in a $HOME/.exrc (.vmrc on Linux) file; in there just say

set ignorecase
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top