Vim Scoops / Lessons / E486: Pattern not found
E486: Pattern not found
E486 means your search or :s command found no match in the file. The usual culprit is case: Vim's search is case sensitive by default, so /mint won't find MINT.
The keys
| Keys | What they do |
|---|---|
/mint\c | Search ignoring case, just this once |
:set ignorecase smartcase | Ignore case unless you type a capital |
/1\.5 | Escape special characters like . |
:%s/old/new/ge | The e flag skips E486 when nothing matches |
The pattern after / is a regular expression. Characters like ., *, [ and ~ mean something special, so a pattern can fail to match text that looks identical.
Searches wrap around the end of the file, so if there's no match anywhere, E486 really does mean the text isn't there.
Related
Want all of Vim, in order? Vim Scoops is a free game that starts at h j k l and builds up to macros.
Play the full game