use '/' to find both upper and lower case instances

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

use '/' to find both upper and lower case instances

luke-44
Hi.

I have a need to use '/' to find something in a file, but I wish it to ignore case.

So say I'm looking for 'foo' then I want to find all instances for 'foo' and 'FOO'

Thanks.
Kind regards.
Luke
Reply | Threaded
Open this post in threaded view
|

Re: use '/' to find both upper and lower case instances

Stefan Karlsson-3

> I have a need to use '/' to find something in a file, but I wish it to
> ignore case.
>
> So say I'm looking for 'foo' then I want to find all instances for 'foo'
> and 'FOO'
>


Use "\c" (for instance "/\cfoo"). If you want this behavior most of the time
you could set the 'ignorecase' option.

By the way, "\C" works oppositite to "\c".

--
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: use '/' to find both upper and lower case instances

luke-44
In reply to this post by luke-44
Hi Luke.

18Aug2006 @ 10:14 Luke Vanderfluit thusly spake
> Hi.
>
> I have a need to use '/' to find something in a file, but I wish it to ignore case.
>
> So say I'm looking for 'foo' then I want to find all instances for 'foo' and 'FOO'

:set ignorecase
then do your usual search.
HTH.

Kind regards.
Luke (-:

>
> Thanks.
> Kind regards.
> Luke
Reply | Threaded
Open this post in threaded view
|

Re: use '/' to find both upper and lower case instances

Alan G Isaac
In reply to this post by luke-44
On Fri, 18 Aug 2006, Luke Vanderfluit apparently wrote:
> I have a need to use '/' to find something in a file, but I wish it to ignore case.

:h \c

hth,
Alan Isaac



Reply | Threaded
Open this post in threaded view
|

Re: [unclassified] Re: use '/' to find both upper and lower case instances

luke-44
In reply to this post by luke-44
Hi.

17Aug2006 @ 20:53 Dimitriy V. Masterov thusly spake
> Luke,
>
> Have you tried using :set ignorecase before your search?

Yes. And that worked.
Thanks (-:

Kind regards.
Luke.

>
> DVM
Reply | Threaded
Open this post in threaded view
|

RE: use '/' to find both upper and lower case instances

Gene Kwiecinski
In reply to this post by luke-44
>I have a need to use '/' to find something in a file, but I wish it
>to ignore case.

>So say I'm looking for 'foo' then I want to find all instances for
>'foo' and 'FOO'

Can try

        :set ignorecase
or
        :set ic

to do so.  Former will almost always work, latter works on some variants
of 'vi' but not all.