emacs: Special Isearch
15.1.5 Special Input for Incremental Search
-------------------------------------------
In addition to characters described in the previous subsections, some of
the other characters you type during incremental search have special
effects. They are described here.
To toggle lax space matching (lax space matching Lax Search.),
type ‘M-s <SPC>’.
To toggle case sensitivity of the search, type ‘M-c’ or ‘M-s c’.
case folding Lax Search. If the search string includes
upper-case letters, the search is case-sensitive by default.
To toggle whether or not the search will consider similar and
equivalent characters as a match, type ‘M-s '’. character
folding Lax Search. If the search string includes accented characters,
that disables character folding during that search.
To toggle whether or not invisible text is searched, type ‘M-s i’
(‘isearch-toggle-invisible’). Outline Search.
To toggle between non-regexp and regexp incremental search, type
‘M-r’ or ‘M-s r’ (‘isearch-toggle-regexp’). Regexp Search.
To toggle symbol mode, type ‘M-s _’. Symbol Search.
To search for a newline character, type ‘C-j’ as part of the search
string.
To search for non-ASCII characters, use one of the following methods:
• Type ‘C-q’, followed by a non-graphic character or a sequence of
octal digits. This adds a character to the search string, similar
to inserting into a buffer using ‘C-q’ (Inserting Text).
For example, ‘C-q C-s’ during incremental search adds the
‘control-S’ character to the search string.
• Type ‘C-x 8 <RET>’, followed by a Unicode name or code-point in
hex. This adds the specified character into the search string,
similar to the usual ‘insert-char’ command (Inserting
Text).
• Use an input method (Input Methods). If an input method is
enabled in the current buffer when you start the search, the same
method will be active in the minibuffer when you type the search
string. While typing the search string, you can toggle the input
method with ‘C-\’ (‘isearch-toggle-input-method’). You can also
turn on a non-default input method with ‘C-^’
(‘isearch-toggle-specified-input-method’), which prompts for the
name of the input method. When an input method is active during
incremental search, the search prompt includes the input method
mnemonic, like this:
I-search [IM]:
where IM is the mnemonic of the active input method. Any input
method you enable during incremental search remains enabled in the
current buffer afterwards.
Typing ‘M-s o’ in incremental search invokes ‘isearch-occur’, which
runs ‘occur’ with the current search string. occur Other
Repeating Search.
Typing ‘M-%’ in incremental search invokes ‘query-replace’ or
‘query-replace-regexp’ (depending on search mode) with the current
search string used as the string to replace. A negative prefix argument
means to replace backward. Query Replace.
Typing ‘M-<TAB>’ in incremental search invokes ‘isearch-complete’,
which attempts to complete the search string using the search ring (the
previous search strings you used) as a list of completion alternatives.
Completion. In many operating systems, the ‘M-<TAB>’ key
sequence is captured by the window manager; you then need to rebind
‘isearch-complete’ to another key sequence if you want to use it (
Rebinding).
You can exit the search while leaving the matches for the last search
string highlighted on display. To this end, type ‘M-s h r’
Highlight Interactively::) passing it the regexp derived from the last
search string and prompting you for the face to use for highlighting.
To remove the highlighting, type ‘M-s h u’ (‘unhighlight-regexp’).
When incremental search is active, you can type ‘C-h C-h’
(‘isearch-help-map’) to access interactive help options, including a
list of special key bindings. These key bindings are part of the keymap
‘isearch-mode-map’ (Keymaps).