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

Re: search in files

Expand Messages
  • Wolfgang Schmidt
    ... Hi, what you re looking for is grep/vimgrep, I think. grep uses an external grep command, vimgrep is a built-in functionality of vim. ... This uses the **
    Message 1 of 2 , Oct 31, 2006
    • 0 Attachment
      bolow wrote:
      > hi all,
      > I have a question:how to search a keyword in all files in a current
      > dir(include the sub dirs) by vim? thanks for your reply:)
      Hi,

      what you're looking for is grep/vimgrep, I think.

      grep uses an external grep command, vimgrep is a built-in functionality
      of vim.

      To search the current directory for all files containing String "aString":

      :vimgrep /aString/ *

      To do the same search including sub dirs:

      :vimgrep /aString/ **/*

      This uses the ** ("starstart)"-wildcard to match subdirectories.

      For more information try
      :help grep
      :help vimgrep
      :help starstar


      Kind regards
      Wolfgang
    Your message has been successfully submitted and would be delivered to recipients shortly.