# Vim - Grep in Opened Buffers
## Metadata
**Status**:: #x
**Zettel**:: #zettel/literature
**Created**:: [[2023-08-03]]
**Topic**:: [[♯ Vim]]
## Synopsis
Clear the errors list first.
```
cexpr []
```
Then use `argdo`, `bufdo` to loop and add the grep result.
```
args `git grep -l pattern`
argdo vimgrepadd /pattern/g %
```
Another solution is adding list of files from a command line output:
```
vimgrep /pattern/g `git grep -l pattern`
```