Vim Recall繁體中文

Review every replacement

:%s/colour/color/gc

Example

Normal mode. Line: colour palette; colour wheel.

Before
colour palette; colour wheel
  1. :%s/colour/color/gc<CR> Confirmation prompt · first colour
  2. y Replace first match · color palette; colour wheel
  3. n Skip second match · color palette; colour wheel
After
color palette; colour wheel
Details & Vim help

Ask before replacing each matching occurrence.

Keep a broad replacement under manual control.

The example answers y then n. % covers every line, g covers all matches per line, and c asks for confirmation. Vim patterns are not literal strings.

Try it in Vim

  1. Run :%s/colour/color/gc<CR>.
  2. At each prompt use y to replace or n to skip.
  3. Use q to stop; a accepts all remaining matches.