Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Vim

Author: Robert Hyatt

Date: 22:24:26 05/15/04

Go up one level in this thread


On May 15, 2004 at 13:31:03, Frank Phillips wrote:

>On May 15, 2004 at 13:25:00, James Swafford wrote:
>
>>On May 15, 2004 at 12:19:42, Frank Phillips wrote:
>>
>>>How do you substitute a string with spaces in, in Vim?
>>>
>>>eg  %s:/some thing with spaces/with this/g
>>>
>>>does not work - because of the search pattern rather than the substitute string.
>>>
>>>I have read a lot, but other than concluding Vim can do almost anything, have
>>>not worked out how to do the above.  I would use fgrep of course in other
>>>situations.
>>>
>>>Frank
>>
>>Have you tried using the \s escape character?
>>
>>s/some\sthing\swith\spaces/with\sthis/g
>>
>>--
>>James
>
>
>I tried this.  The real search string was
>
>/BoardT *pboard/
>
>I think the problem was the  *  , where I did not do \*  ...sigh.


In working with C/C++ programs you probably should do this:

:set nomagic

in your .exrc file...

That turns off the meta-characters, particularly *, [ and ] which are common C
characters as well...




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.