Loading ...
Sorry, an error occurred while loading the content.
 

Re: substitutions above and under the matched line

Expand Messages
  • Bruce Mellows
    Its obvious, but I ll say it Its nice (once you get used to it) to use the patterns from :help whitespace So that [^I ] can be replaced with s UURGHH
    Message 1 of 5 , Sep 30, 2002
      Its obvious, but I'll say it

      Its nice (once you get used to it) to use the patterns from ':help
      whitespace'

      So that "[^I ]" can be replaced with "\s"

      UURGHH UURGHH... more power

      Matt wrote:

      >Quoting Piet Delport <pjd@...>:
      >
      >
      >>You could use something like:
      >>
      >> :s/^.*/#ifdef DEBUG_STDOUT\r&\r#endif/
      >>
      >>
      >>
      >
      >Wonderful!
      >Thanks to your help, the solution seems to be:
      >
      >:%s/^[^I ]*printf(.*/#ifdef DEBUG_STDOUT\r&\r#endif/
      >
      >I think that it means:
      >Match lines with the word "printf", if it is the first word on the line (ignore
      >leading whitespace characters).
      >
      >Is it the right meaning?
      >
      >Thanks.
      >Regards,
      >Matt
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.