LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2005, 09:58 AM   #1
jcombs_31
Member
 
Registered: Dec 2004
Distribution: Slackware
Posts: 104

Rep: Reputation: 15
vi


I was working with a file using vi and accidentally hit something that keeps telling me "wrapped" when doing a search. I can't figure out what I hit and how to undo this.
 
Old 11-14-2005, 10:14 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
wrap in a search just tells you it didn't find what you were looking for from the point in the file you were at to the bottom so it started at the top to search from there down to the point you were in the file. (Assuming you did "/pattern" - if "?pattern" it means it searched from your start point to the top of the file and then went to the bottom and searched up to your starting point there.)

This is standard for vi and is not a problem. If you really want to turn it off though you can type:

":set nows" which tells it to turn off wrap scan.
It will then only search from the point in the file you were at to the bottom ("/") or the top ("?").

To turn ON the wrap scan just do:

":set ws"

You can also make these settings your defaults by putting them in .exrc in your home directory. That file is read whenever you start vi/vim. Just leave out the colon (":").
 
Old 11-14-2005, 12:00 PM   #3
jcombs_31
Member
 
Registered: Dec 2004
Distribution: Slackware
Posts: 104

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by jlightner
wrap in a search just tells you it didn't find what you were looking for from the point in the file you were at to the bottom so it started at the top to search from there down to the point you were in the file. (Assuming you did "/pattern" - if "?pattern" it means it searched from your start point to the top of the file and then went to the bottom and searched up to your starting point there.)

This is standard for vi and is not a problem. If you really want to turn it off though you can type:

":set nows" which tells it to turn off wrap scan.
It will then only search from the point in the file you were at to the bottom ("/") or the top ("?").

To turn ON the wrap scan just do:

":set ws"

You can also make these settings your defaults by putting them in .exrc in your home directory. That file is read whenever you start vi/vim. Just leave out the colon (":").
Thanks, I guess I must have accidentally cut out a bunch of lines then somehow.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration