Tracy R Reed wrote:
That seems strange to me but maybe it is a matter of familiarity. Search
and replace in vi is just regex. :%s/foo/bar is almost like instinct to
me and pretty intuitive.

It's not the regex that's the problem. It's the auxiliary stuff. Does that syntax work for *all* vi flavors?

I seem to recall that you forgot an extra slash as well as some silly "global" flag or you only get 1 replacement per line. Or, is it a vim extension that you don't need it?

I'm pretty sure we're talking:

:%s/foo/bar/g

So, I need to remember the "all lines" operator "%" which is specific to vi and has no discoverability. I also need to remember the "g" global flag which is specific to vi and has no discoverability.

The difference, for me, when I hit M-% to start the search and destroy in emacs (which is the only reason I can actually remember the % in vi) is that the system actually gives some prompting as to how to complete the keystrokes to finish off the search-and-destroy.

-a

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to