Stewart Stremler wrote:
begin quoting Ralph Shumaker as of Wed, Jan 31, 2007 at 09:40:40PM -0800:
[snip]
With
the s:/// command in help, it says to use "[c]" after the final "/".
(It does not say whether or not the braces are needed. It makes me
think that they are needed except that previously in the same command
they have "s[ubstitute]/".)
It's common to use brackets to indicate optional bits; I don't
know the origin, but it's been common practice for as long as
I've been looking at computer manuals, and it seemed an established
convention even then.
Yeah, that's what I always thought, but sometimes memory rusts a bit.
Is "\1" and "\2" part of regular expressions? Or is that something
native to vi?
Um, technically, no, as regular expressions are 'recognizers'. However,
for regular-expressions-used-as-transformations, it's pretty common
syntax.
How can I find out more about "\1", "\2", and the like?
Is there something simple (like a pamphlet) to explain *just* the basics
of regular expressions?
There's a whole book: "Mastering Regular Expressions", and most
vi, sed, and perl books have a section on the basics of regular
expressions.
Wikipedia has a decent history with a section some of the basics:
http://en.wikipedia.org/wiki/Regular_expression
Thanx.
(I just noticed the drift from my subject line which happened before I
even sent it. It turns out that I started in "man vi", and very *very*
reluctantly started looking in "info vi". But I never had the patience
to learn the /language/ (so to speak) of "info". They should consider
setting up something like man or info in html.)
There are manpages in html. All over the place.
See
http://unixhelp.ed.ac.uk/CGI/man-cgi
for one.
I *like* that one. The very first one I looked at had links to other
commands mentioned therein. One nice thing about html is that it
doesn't take a lot of learning to be able to navigate (unlike "info",
which is *still* a mystery to me).
Also, in vi, how do I make ":set mouse=a" permanent?
Put it in your .exrc (for vi, vim, and gvim), .vimrc (for vim and gvim),
or .gvimrc (for just gvim), sans leading colon.
You mentioned both .exrc *and* .vimrc for vim. Does it need to go into
both? (I think it's vim that I'm using, although I just type vi.)
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list