ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Could you elaborate? the :set ignorecase is exactly how you do it in vi. Are you saying it doesn't work? Are you trying to do a command line option?
Is it perhaps that you don't understand the usage. You do the ":set ignorecase" then hit enter THEN do the search - you're not trying to do it all on one line are you?
Or maybe you're trying to figure out how to turn it on so you don't have to bother typing the :set each time? If so:
Type "echo set ignorecase" >>.exrc" in your home directory.
The .exrc is read each time you start vi.
Of course its possible you have some flavor of vi that doesn't understand ed set commands but I haven't yet run across one (but then again I immediately install vim wherever I see nvi).
Last edited by MensaWater; 10-25-2005 at 12:12 PM.
I found this in the vim user manual pages (chapter 27.1) for you. Sounds like what you might want.
Quote:
CASE IN ONE PATTERN
If you want to ignore case for one specific pattern, you can do this by
prepending the "\c" string. Using "\C" will make the pattern to match case.
This overrules the 'ignorecase' and 'smartcase' options, when "\c" or "\C" is
used their value doesn't matter.
pattern matches ~
\Cword word
\CWord Word
\cword word, Word, WORD, WoRd, etc.
\cWord word, Word, WORD, WoRd, etc.
A big advantage of using "\c" and "\C" is that it sticks with the pattern.
Thus if you repeat a pattern from the search history, the same will happen, no
matter if 'ignorecase' or 'smartcase' was changed.
Heheh, yeah, there is a lot there. I'm sure emacs has just as much, though. In this case, I found it simply by typing :help regexp, and then following some links in the help. (By moving the cursor over the links and hitting ctrl-])
Anyway, you don't really need to memorize everything vim can do. Once you pick up a few key features you can get along with it pretty well. But if there is ever something you want to find a way to do quicker in vim, there are probably more things you don't know about that you can search the help for.
Yes I know. Been using vi since 1991 - vim has a few more features but vi (not nvi which bites) has a similarly long man page. I was just noting this is why no one actually memorizes it.
I am NOT a fan of emacs. In fact when developers ask me to install emacs for them I tell 'em to go pound sand (or do "man vi" which they somehow take the same way )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.