Q:

Loading a set of files obtained via command into Vim buffers

I normally do a find -type f | xargs grep 'something' and try to open those files in the Vim. What is happening is, I have to close and open Vim sessions and sometimes, I have to do the find operation again, if I had lost the result. Is there a way to automate this in Vim, like I would like the Vim to open all these files into separate buffers so that I can switch between them seamlessly? Note that I am looking if I can execute these find commands from within Vim (using !) and then load those files as buffers.
Any other tricks you would use, if you are in for above situation?

A:

Vim has several commands integrating and implementing Grep capabilities (see
:help grep).  The two major ones are :grep and :vimgrep.  The former
uses external Grep program (set by grepprg option), while the latter uses
core Grep functionality implemented in Vim itself.
The main advantages of the internal :vimgrep are Vim regex syntax and
portability, that includes ** glob wildcard.  The :vimgrep command
understands a subset of extended glob patterns (see :help wildcard).  This
allows to avoid find command in most of the cases.  Using :vimgrep, your
example search would look like the following.
:vimgrep /something/ **/*

The same search can be performed with :grep command, if your shell or
grepprg implements the ** wildcard.  Below is an example showing Zsh
extendned glob notation.
:grep 'something' **/*(.)

Both of these commands (and their variants) utilize Vim interface features
called QuickFix list and its window-local version, location list (see :help
quickfix).  The QuickFix window is a special read-only buffer containing any
kind of search results relating one or several files.  Search results
collected by Grep commands are immediately aggregated in the QuickFix window.
The QuickFix list represents each matching position of the search pattern by
a single line, and allows to quickly switch between them by pressing
Enter on these lines.  There is not a few commands related to the
QuickFix list.  Here I list only some of them as a starting point (see help
for additional information).

:cw or :cope open the QuickFix window (see help to understand the
difference between them).
:cc, :cn, :cp display the current, the next, and the previous
match in the list, respectively.
:cr, :cla display the first, and the last match in the list,
respectively.
:ccl closes the QuickFix window.

A location list is a QuickFix list attached to a certain window.  Each window
can have a single location list attached to it (independent from other
windows' location lists and the QuickFix list).  Any QuickFix list command
of those listed above has an equivalent working with a location list.

:lw or :lop open the location list associated with the current
window.
:ll, :lne, :lp display the current, the next, and the previous
match in the list, respectively.
:lr, :lla display the first, and the last match in the list,
respectively.
:lcl closes the location list.

Location list counterparts of the :grep and :vimgrep commands are :lgrep
and :lvimgrep, respectively.

