Vim Recall繁體中文

Run 'grepprg' and jump to first match

:grep

Example

Normal 0 / 2

Run 'grepprg' and jump to first match.

Search configuration

grepprg
internal

Quickfix list

Empty
Before & after

Before

Search configuration

grepprg
internal

Quickfix list

Empty

After

Search configuration

grepprg
internal

Quickfix list

1
tasks.txt:1: TODO first
2
tasks.txt:3: TODO last

Documentation-backed illustration. +quickfix, the shown tasks.txt, grepprg=internal for grep-family commands, and Vim's /pattern/j syntax. :grep creates the two TODO matches in the quickfix list. The j flag keeps the current buffer and cursor. Primary help: :grep.

Sample buffer
alpha
beta
gamma
Cursor on line 1, column 1
Details & Vim help

Run 'grepprg' and jump to first match. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :gr[ep] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.