in vi, / to search - Unix

This is a discussion on in vi, / to search - Unix ; 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....

+ Reply to Thread
Results 1 to 7 of 7

Thread: in vi, / to search

  1. in vi, / to search

    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.


  2. Re: in vi, / to search

    Begin <1110971316.344872.260760@o13g2000cwo.googlegroups. com>
    On 2005-03-16, yls177 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:


    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.


    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 .

  3. Re: in vi, / to search

    yls177 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

  4. Re: in vi, / to search

    On 16 Mar 2005 03:08:36 -0800, yls177 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.


  5. Re: in vi, / to search

    On 16 Mar 2005 15:13:36 GMT,
    Dave Hinz wrote:


    > On 16 Mar 2005 03:08:36 -0800, yls177 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.
    >


    If the file was opened with vi for some other reasons, it would make sense
    to use the search function of vi.


    Villy

  6. Re: in vi, / to search

    On 16 Mar 2005 15:50:20 GMT, Villy Kruse wrote:
    > On 16 Mar 2005 15:13:36 GMT,
    > Dave Hinz wrote:
    >
    >
    >> On 16 Mar 2005 03:08:36 -0800, yls177 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.

    >
    > 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.


  7. Re: in vi, / to search


    Dave Hinz wrote:
    > On 16 Mar 2005 15:50:20 GMT, Villy Kruse

    wrote:
    > > On 16 Mar 2005 15:13:36 GMT,
    > > Dave Hinz wrote:
    > >
    > >
    > >> On 16 Mar 2005 03:08:36 -0800, yls177 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.

    > >
    > > 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.



    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.


+ Reply to Thread