Emacs: Search Text

By Xah Lee. Date: . Last updated: .

Interactive Search

isearch-forwardCtrl+s

Interactive search text in current buffer.

While in isearch prompt:

  • Ctrl+s → Jump to next occurrence
  • Ctrl+r → Jump to previous occurrence.
  • Ctrl+g → Exit and place cursor at original position.
  • Enter → Exit and place cursor at current position.
  • Ctrl+y → paste to the prompt.
emacs isearch 2024-06-23
emacs isearch 2024-06-23

Smart Case Sensitivity

in isearch, if the search text:

Toggle Case Sensitivity

Alt+x toggle-case-fold-search

Remember to toggle it back.

Smart Character Equivalence

emacs has many settings that control character equivalence for isearch, such as whitespace equivalence, unicode chars equivalence e.g. e é, 1 ①.

Search Word in Computer Language Source Code (Symbol with Boundary Check)

Search Current Symbol

isearch-forward-symbol-at-pointAlt+s .
emacs isearch symbol 2025-08-09 29c92
emacs isearch symbol 2025-08-09 29c92

Search Symbol

isearch-forward-symbolAlt+s _

search for a symbol with boundary check.

Interactive Search Sequence of Words

isearch-forward-wordAlt+s w

like isearch, but space is considered equivalent to newline, hyphen, lowline, comma, or other punctuations.

If you have isearch config set to whitespace equivalence, then this command is not very useful.

Interactive Search by Regex Pattern

Ctrl+u Ctrl+s

(this calls isearch-forward in regex mode.)

Non-Interactive Search (No Smart Features)

these are useful if you want to search text verbatim, ignore all smart equivalence of chars.

Alt+x search-forward

search text after cursor position.

Alt+x re-search-forward

search text after cursor position, using Emacs: Regular Expression Syntax

Reference

Emacs Find Replace