General
cancel
Showing results for 
Search instead for 
Did you mean: 

Scrolling previous searches in the vi editor (not n or N)

SOLVED
Go to solution
yaron1
Advisor

Scrolling previous searches in the vi editor (not n or N)

Hi,

How can scroll (or recall) previous searches (/) done in the same session of vi. I dont mean here the last search with n or N. I mean searches before the last one.
This is equivalent to Esc k or j in recalling commands previously typed at the POSIX shell prompt (or arrow up down in bash shell).

Thanks for answers.
5 REPLIES
Johnson Punniyalingam
Honored Contributor

Re: Scrolling previous searches in the vi editor (not n or N)

Hi Yaron,

Check below thread if its helpfull ?

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1259589487149+28353475&threadId=1040133


Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: Scrolling previous searches in the vi editor (not n or N)

http://elvis.rowan.edu/~nlt/viunix.html
Problems are common to all, but attitude makes the difference
Bill Hassell
Honored Contributor
Solution

Re: Scrolling previous searches in the vi editor (not n or N)

To my knowledge, vi does not have a search history (except the last search).


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Scrolling previous searches in the vi editor (not n or N)

I would assume vim may have what you want? You would have to find the particular search and redo that one. Not sure if you can redo any but ":" commands?

>Johnson: Check below thread if its helpful?

This is about shell history instead of vi history.
Steve Post
Trusted Contributor

Re: Scrolling previous searches in the vi editor (not n or N)

I have a search history for vi:
a piece of paper and a pencil.
It's been working great for years.

Well ok.... I admit it puts the vi application in a bad light. But I rarely search for more than 2 things in a set of 40 files.

After a bit, I upgraded.
I switched the paper and pencil with windows notepad and putty. I use cut and paste. It has proved very useful when I need to search for a set of five, 30 character strings.