Kamaraju S Kusumanchi wrote:
Hi
    I need to search for a word 'condition' (without quotes) and exclude
hits containing 'condition number'.

On a shell I can do

grep -sir condition *F90 | grep -v 'condition number'

How do I do it the vim way?

thanks
raju


Try

        :g/\<condition\>\%(\s\+number\>)[EMAIL PROTECTED]/p

Explanation of the pattern

        \<              begin of word (don't match "precondition")
        condition       matches itself
        \>              end of word (don't match "conditional")
        \%(             start subpattern
        \s\+            any number of whitespace (at least one)
        number          matches itself
        \>              end of word ("condition numbering" is different)
        \)              end subpattern
        [EMAIL PROTECTED]             subpattern must NOT match

For :g/pattern/p see ":help :g"


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
140. You'd rather catch a score on the web than watch the game as
     it is being played on tv.

Reply via email to