reference Flags

--vim

Accepted by
opengrep scan, opengrep ci
See also
--emacs, --json, --output, --files-with-matches, --vim-output

Prints one line per finding:

PATH:LINE:COL:SEVERITY:RULE_ID:MESSAGE

The severity is a single letter, such as W for a warning. Vim's errorformat reads these lines, so :cfile loads the output as a quickfix list.

--vim-output writes the same lines to a file, in addition to the output on standard output. Only one format can be printed to standard output, so --vim cannot be combined with --json, --emacs, --sarif and the other formats.

Examples

One line per finding

rule.yaml
rules:  - id: find-eval    pattern: eval(...)    message: found eval    languages: [python]    severity: WARNING
app.py
eval(1)
Command and result
$ opengrep scan -q --config rule.yaml --vim app.py
app.py:1:1:W:find-eval:found eval