On Jul 1, 2:21 pm, _sc_ <[email protected]> wrote:
> On Wednesday 01 July 2009 11:52 am, googler wrote:
>
>
>
> > Suppose I am editing/viewing a file and searching for different
> > regular expressions in the file, for example, issuing commands "/
> > abcd", "/efgh", "/ijkl" and "/mnop". Since my last search was for
> > "mnop", that's what I have highlighted currently. Now if I want to go
> > back to the previous search or the one (or two) before that, what is
> > the easiest way to do that? I do not want to type the whole search
> > string again. Is there a shortcut? If not, does there exist any script
> > that I can use to get this functionality?
>
> yet another method that everyone's been ignoring is to hit '/'
> followed by ctrl-F to open the search history window
>
> can't have too many choices now, can we
>
> sc
Hi everybody, thanks for your replies. All this information will
definitely be helpful. However, when I posted this question, what I
was thinking was if there is a keystroke or two that will take me to
the previous search or the one before that. Something like pressing
CTRL key or a function key. Seems like there is no such shortcut. So
was thinking if one can create such a mapping.
Say I'm only interested in the last two searches - pressing F4 will
take me to the previous search and F5 to the one before that. How can
I create such a mapping? I checked a little bit and saw that vim saves
only the last search string in a register ("/) and not the ones
before. So when I perform a new search through / or ? , I should save
my "/ content in another register to be used by F4 and F5. Is that how
it should be done?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---