Back to Lessons
Sign inintermediate

Search Review

Combine search techniques: /, n, *, and :s

Open companion guide

Goals

0/2
  • Use :s/old/new/g to replace text
  • Combine search with replace
Keys 0 · par 20

Instructions

  1. 1.Replace all "foo" with "bar" using :s/foo/bar/g
  2. 2.This replaces all matches on the current line
Quick KeysNORMAL
h j k lMove cursor
w b eWord movement
i a oEnter insert
dDelete
yYank (copy)
pPaste
uUndo
vVisual mode
:Command mode
/Search

Community pulse

Weekly top score
Leaderboard warming up...
Daily challenge
Loading challenge...
Vim mode: normal

Practice buffer · reset restarts the lesson (not vim u)

Lesson Companion

Use Search Review in real editing

This companion guide helps you complete Search Review with fewer mistakes and better command fluency.

Quick Command Cheatsheet
  • substitute
  • :s
When to Use This Motion/Operator

Use this lesson whenever you need to scan code quickly for repeated symbols or terms with fewer keystrokes.

  • Prefer this over arrow-key micro-movements before each edit.
  • Use this pattern whenever you're working inside Search & Replace tasks.
  • Reach for substitute, :s when this pattern appears.
Common Mistakes
  • Searching without using n/N to step between matches.
  • Forgetting * and # to search the word under the cursor.
FAQ

How long should this lesson take?

Target completion is 60 seconds, but correctness matters more than speed at first.

Should I move to the next lesson if my score is low?

Revisit the specific commands you missed rather than replaying the whole lesson — targeted practice closes gaps faster at this level.