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

Re: Search Multiple Files

Expand Messages
  • Nate-37
    ... I use the Grep.vim plugin. It helps you search within subdirectories, and displays nice search results that you can easily jump to.
    Message 1 of 4 , Oct 29, 2008
    • 0 Attachment
      > > I switched from TextWrangler to MacVim and so it's going ok, but I
      > > miss the ability to search multiple files simultaneously, is there any
      > > way to do this in MacVim?

      I use the Grep.vim plugin. It helps you search within subdirectories, and
      displays nice search results that you can easily jump to.
      http://www.vim.org/scripts/script.php?script_id=311

      You install the plugin, then, when you want to search for something, you
      type

      :Rgrep

      There's a bazillion different commands you can use. Give it a try.
      Regarding your "open in different windows" question, you can place the
      cursor on a search result, then
      press gF (I think) and it will open in a new window. See :help gf for ways
      to open a file.

      One thing I would note is that on a Mac, I have these settings:

      " Tell Rgrep not to use Xargs on Mac OS 'cause it sucks.
      " Previously used has("mac"), except this doesn't work in
      " a terminal, and fubars the grep.vim plugin
      let s:os = system("uname")
      if s:os =~ "Darwin"
      let g:Grep_Xargs_Options='-0'
      endif




      --Nate

      Israel-25 wrote:
      >
      >
      > Hi Björn,
      >
      > Thanks for the info, I'll look into that.
      >
      > Israel
      >
      > On Oct 26, 4:55 pm, "björn" <bjorn.winck...@...> wrote:
      >> Hi Israel,
      >>
      >> 2008/10/26 Israel <israelcha...@...>:
      >>
      >>
      >>
      >> > I switched from TextWrangler to MacVim and so it's going ok, but I
      >> > miss the ability to search multiple files simultaneously, is there any
      >> > way to do this in MacVim?
      >>
      >> > TextWrangel shows the results in a two sections window, with the file
      >> > names in one and the contents of the selected file in the other, there
      >> > is the option to open the file in a new window also.
      >>
      >> I'm sure you'll get more answers if you post this question on the
      >> vim_use mailing list, but I can at least tell you how I search through
      >> multiple files (although I'm no expert at these things).
      >>
      >> I use the :vimgrep command, so if I want to search through all c-files
      >> for "hello world" I do something like:
      >>
      >> :vimgrep /hello world/ *.c
      >>
      >> That will set the quickfix list and you can step through all matches
      >> with :cn and :cp.  You can see all the matches in a new window by
      >> typing :cw and then you can also hit enter on a line to open the file
      >> where that match was.  Read all about it by typing
      >>
      >> :h quickfix
      >>
      >> Björn
      > >
      >
      >

      --
      View this message in context: http://www.nabble.com/Search-Multiple-Files-tp20178049p20231244.html
      Sent from the Vim - Mac mailing list archive at Nabble.com.


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.