|
Home > Archive > Unix administration > March 2005 > in vi, / to search
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
in vi, / to search
|
|
| yls177 2005-03-16, 7:58 am |
| Hi, in vi, / is used to search for strings. However, i noticed that
this is case sensitive. Are there any options which i could search in
"vi filename"?
Please advise.
| |
|
| Begin <1110971316.344872.260760@o13g2000cwo.googlegroups.com>
On 2005-03-16, yls177 <yls177@hotmail.com> wrote:
> Hi, in vi, / is used to search for strings. However, i noticed that
> this is case sensitive. Are there any options which i could search in
> "vi filename"?
>
> Please advise.
It is advisable to read the relevant manpage before asking:
<quote from="vi(1)" comment="FreeBSD, hence nvi">
VI COMMANDS
[...]
: Execute an ex command.
[...]
EX COMMANDS
[...]
se[t] [option[=[value]] ...] [nooption ...] [option? ...] [all]
Display or set editor options.
[...]
SET OPTIONS
[...]
ignorecase, ic [off]
Ignore case differences in regular expressions.
</quote>
Meaning that you can give the command ``:set ic'' and you'll be all set.
Unsetting is left as an excercise to the reader.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
| |
| Laurenz Albe 2005-03-16, 7:58 am |
| yls177 <yls177@hotmail.com> wrote:
> Hi, in vi, / is used to search for strings. However, i noticed that
> this is case sensitive. Are there any options which i could search in
> "vi filename"?
It probably depends on what vi you are using, but try
:set ignorecase
Yours,
Laurenz Albe
| |
| Dave Hinz 2005-03-16, 6:02 pm |
| On 16 Mar 2005 03:08:36 -0800, yls177 <yls177@hotmail.com> wrote:
> Hi, in vi, / is used to search for strings. However, i noticed that
> this is case sensitive.
Yes.
> Are there any options which i could search in
> "vi filename"?
I don't understand the question. If you're using vi to search, consider
using grep -i instead.
| |
| Villy Kruse 2005-03-16, 6:02 pm |
| On 16 Mar 2005 15:13:36 GMT,
Dave Hinz <DaveHinz@spamcop.net> wrote:
> On 16 Mar 2005 03:08:36 -0800, yls177 <yls177@hotmail.com> wrote:
>
> Yes.
>
>
> I don't understand the question. If you're using vi to search, consider
> using grep -i instead.
>
If the file was opened with vi for some other reasons, it would make sense
to use the search function of vi.
Villy
| |
| Dave Hinz 2005-03-16, 6:02 pm |
| On 16 Mar 2005 15:50:20 GMT, Villy Kruse <vek@station02.ohout.pharmapartners.nl> wrote:
> On 16 Mar 2005 15:13:36 GMT,
> Dave Hinz <DaveHinz@spamcop.net> wrote:
>
>
>
> If the file was opened with vi for some other reasons, it would make sense
> to use the search function of vi.
Yes. Whatever he's doing, he could get better answers with a more detailed
question.
| |
| yls177 2005-03-18, 2:47 am |
|
Dave Hinz wrote:
> On 16 Mar 2005 15:50:20 GMT, Villy Kruse
<vek@station02.ohout.pharmapartners.nl> wrote:
that[vbcol=seagreen]
consider[vbcol=seagreen]
make sense[vbcol=seagreen]
>
> Yes. Whatever he's doing, he could get better answers with a more
detailed
> question.
My vi is as belows
" vi(1)
vi(1)
NAME
vi, view, vedit - screen-oriented (visual) text editor"
At least that is what i typed after a "man vi". Yup, ":set ic" will
cause it to be case insensitive. Cheers!
oops.. and to unset, i have to do ":set noic"
Cheers!
Thanks for your guidance.
|
|
|
|
|