On 22/11/09 19:17, Shagen Ogandzhanjan wrote:
> Hello everybody.
> I have a question, which google can not help me to resolve.
>
> The task is to fetch all files matching pattern (for instance, matching
> some file extension)
> and to place all into the quickfix list (or location list, I don't mind).
>
> The only way personally I know is to write something like this:
> *:vim /\%1l/j **/*.xml*
>
> But I do really miss some clever advices, I guess.
> I do believe there should be a much more elegant way to say - "I want to
> put into the quickfix list files mathing some patterns, but i don't care
> about what each file contains"
>
> thanks anyone (or everyone ))) for any help.

That vimgrep command is all right: /\%1l/j means
        /       start pattern
        \%1l    (backslash, percent, one, ell) match only on line one
        /       end of pattern
        j       don't show the file at end of search

Without the j you would be shown the first match (the first line of the 
first file), then :cn or :cnf would bring you to the next file, :cprev 
or :cpf to the previous one, :cfirst or :clast, well, you guess where. 
Then **/*.xml* means «every file which has "dot icks em el" anywhere in 
its name at any depth below the current directory».

See also ":help :find".


Best regards,
Tony.
-- 
Eisenhower was very nice,
Nixon was his only vice.
                -- C. Degen

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to