Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2001 10:41:00 +0200
From:      Olivier Cortes <olive@deep-ocean.net>
To:        Jorge Biquez <jbiquez@icsmx.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Re: Simple Editor for a newbie?
Message-ID:  <20010828104100.A48733@APastourelles-102-1-2-26.abo.wa>
In-Reply-To: <5.1.0.14.2.20010827190112.01eed8d0@icsmx.com>; from jbiquez@icsmx.com on Mon, Aug 27, 2001 at 07:01:48PM -0500
References:  <5.1.0.14.2.20010827183056.01ee8cb0@icsmx.com> <20010827235717.64861.qmail@web11708.mail.yahoo.com> <5.1.0.14.2.20010827190112.01eed8d0@icsmx.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

vi works with regular expressions to replace words or whatever you
want. first throw is:

:1,$ s/myword/otherword/g

--> the double dot (command mode), "1" (from first line) , comma, "$"
(to last line), "s" (substitute), "/" [what to substitute, or regexp],
"/" , [with what do you want it substituted] "/", "g"(i don't know,
look at the man).

you can try:

:1,$ s/^#.*$//g

it will obliterate all comment lines in a shell script or a config
file, or a perl script (in facts lines beginning with a #).

:1,$ s/\w+/\($1)\)/g

will put every word between parenthetis (useless but example).

i will not go further because i'm not a regexp master (the 3rd example
could be false actually). Find some docs about regexp (plenty of links
found on the "ereg" function page of the www.php.net site) and read
the vi tutorial (:h) and help. go for vim (in the ports) to find an
even more powerfull app.

I use indiferently emacs and vi. what i can do in the first i can do
in the other, but vi is quicker to load. emacs is more comfortable but
more "heavy" (don't start a flame war, it's just personnal mind).

i use vi to edit config files quickly on all my servers and emacs to
edit php/perl/shell/web sites when speed is not needed because i do it
all across the day (the editor is loaded only once in the morning).

so try emacs if you like, it's perhaps better for starting with
"power" editors.

hope this helps,

Olivier
FreeBSD Sys/Net admin 


On Mon, Aug 27, 2001 at 07:01:48PM -0500, Jorge Biquez wrote:
> hello.
> 
> yes. command line first and then the easier part (I hope so).....
> 
> jb
> 
> At 16:57 27/08/01 -0700, you wrote:
> >Are you sticking with the command line? There are a
> >number of graphical editors out there for any of the
> >desktops you might install.
> >
> >
> > > Hello.
> > >
> > > I have been trying to convince some friends to take
> > > a look to FreeBsd. For
> > > most of them this will be their first contact to the
> > > *NIX world.
> > > I'm trying to help them to know the basics now (we
> > > are just beginning) and
> > > I'd like that the transition will be easy.
> > > I found myself that the first "problem" we newbies
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

---
Olivier Cortes
free software admin

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010828104100.A48733>