On Sat, 2007-06-09 at 16:20 -0700, Andrew Lentvorski wrote: > 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. >
And in the various IDEs I use, I can select the "Find" menu item, select the function I want (replace vs. find vs. replace all) and send it running. No need to remember anything. I can just get the job done. PGA -- Paul G. Allen BSIT/SE Owner/Sr. Engineer Random Logic Consulting www.randomlogic.com -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
