Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today!
Try Our New Product Showcase!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > The Community > The Coffee Lounge > Question about vi

Forgot Password?
 The Coffee Lounge   Chat area for general discussion, announcements, new member introductions, off-topic items, telling a joke, or just relaxing and having some fun

Site Navigation
Linux Forums
Linux Articles
Product Showcase
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Free Publications




Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 05-28-2005   #1 (permalink)
Linux Enthusiast
 
Join Date: Jan 2005
Posts: 575
Question about vi

How do I do case insensitive search for a regexp ? So I'm looking for commands like
/ or ? but the matching should be case insensitive.
Santa's little helper is offline  



Reply With Quote
Old 05-29-2005   #2 (permalink)
Linux Engineer
 
rong's Avatar
 
Join Date: Feb 2005
Location: California
Posts: 803
Re: Question about vi

Quote:
Originally Posted by Santa's little helper
How do I do case insensitive search for a regexp ? So I'm looking for commands like
/ or ? but the matching should be case insensitive.
I found this so maybe it'll help?? vi search
__________________
registered Linux user #388382

Have you checked here first?
rong is offline   Reply With Quote
Old 05-29-2005   #3 (permalink)
Linux Enthusiast
 
Join Date: Jan 2005
Posts: 575
As far as I can see it doesn't have the information I want.But thanks for the effort.
Santa's little helper is offline   Reply With Quote
Old 05-29-2005   #4 (permalink)
Trusted Penguin
 
Cabhan's Avatar
 
Join Date: Jan 2005
Location: Seattle, WA, USA
Posts: 2,938
Are you trying to find a regexp in your file based on a search term? If that is the case, then do:

Code:
:set ignorecase
This will make searches case insensitive.

The other option is to use:

Code:
:set ignorecase smartcase
This will, if your search term includes no uppercase letters, do a case-insensitive search. If there is an uppercase letter, then the search becomes case-sensitive. So, for example:

bob --> bob, Bob, BOb, BOB, etc.
boB --> boB
BoB --> BoB

And so on.


If you mean that you're trying to search through your file with a regular expression (as in, the search term is a regexp), I found a tutorial which may help at:

http://www.geocities.com/volontir/
__________________
DISTRO=Ubuntu
Registered Linux User #388732
Cabhan is offline   Reply With Quote
Old 05-29-2005   #5 (permalink)
Linux Enthusiast
 
Join Date: Jan 2005
Posts: 575
:set ignorecase was what I was looking for.Thanks a lot.
Santa's little helper is offline   Reply With Quote
Old 05-29-2005   #6 (permalink)
Linux Enthusiast
 
Join Date: Jan 2005
Posts: 575
Come to think of it I have another question: is there a way to do a search
where every character will be interpreted literally ? So for example * will
not mean match 0 or more of something but it will mean a literal *

One way of course is to escape every special character but what I'm looking for
is some option which if set will mean that every character will be interpreted
literally without escaping anything.
Santa's little helper is offline   Reply With Quote
Old 06-06-2005   #7 (permalink)
Linux Enthusiast
 
Join Date: Jan 2005
Posts: 575
Yes there is: you use :set nomagic
I find the name of the option (magic) rather amusing too.

Ok , I have another one.Let's say I'm typing some text where
I plan to use some long word , for example "installation" , a lot.
Is there a way to make it so that by pressing a single button , f1 for
example , the whole word gets printed ?

If you know the answer to this one , even for (x)emacs please share.

By the way , as I found out , instead of writing :set ignorecase you can simply write :set ic
Santa's little helper is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Implementing Detailed User-Level Auditing of UNIX & Linux Systems
Enhance regulatory compliance and troubleshooting through detailed auditing, logging and real-time monitoring of UNIX/Linux user activity.
subscribe
Linux from Scratch - Receive Your Complimentary eBook NOW!
Linux from Scratch describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the source code of software that you need.
subscribe
A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)
Getting Started with Ubuntu 10.04 (Lucid Lynx) is a comprehensive beginners guide for the Ubuntu operating system; it features comprehensive guides, How Tos and information on anything you need to know after first installing Ubuntu.
subscribe
The Incredible Guide to NEW Ubuntu (Karmic Koala)
There are a lot of people still stuck with Windows because it's the ‘easier alternative'. Linux is both cheaper and more versatile than Microsoft's operating system, but the learning curve has frightened off many people.
subscribe
The GNU/Linux Advanced Administration
The GNU/Linux systems have reached an important level of maturity, allowing to integrate them in almost any kind of work environment, from a desktop PC to the sever facilities of a big company.
subscribe
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe



All times are GMT. The time now is 06:19 AM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1