UP | HOME

emacs における isearch の標準便利機能

目次

1 環境

  • Windows 7 64bit
  • gnupackdevel-13.06-2015.11.08
  • GNU Emacs 24.5.1 (i686-pc-cygwin) of 2015-11-08 on gnupack

2 isearch の標準便利機能まとめ

完全一致検索に移行
C-s RET
カーソル位置からリージョンを指定しての検索
C-s C-M-y/w C-M-y/w C-M-y/w…
検索履歴(search ring)
C-s M-n/p M-n/p M-n/p …

3 その他 (M-x describe-key C-s の結果)

C-s runs the command isearch-forward, which is an interactive compiled
Lisp function in `isearch.el'.

It is bound to C-s, <menu-bar> <edit> <search> <i-search>
<isearch-forward>.

(isearch-forward &optional REGEXP-P NO-RECURSIVE-EDIT)

Do incremental search forward.
With a prefix argument, do an incremental regular expression search instead.

As you type characters, they add to the search string and are found.
The following non-printing keys are bound in `isearch-mode-map'.

Type DEL to cancel last input item from end of search string.
Type RET to exit, leaving point at location found.
Type LFD (C-j) to match end of line.
Type C-s to search again forward, C-r to search again backward.
Type C-w to yank next word or character in buffer
  onto the end of the search string, and search for it.
Type C-M-w to delete character from end of search string.
Type C-M-y to yank char from buffer onto end of search string and search for it.
Type M-s C-e to yank rest of line onto end of search string and search for it.
Type C-y to yank the last string of killed text.
Type M-y to replace string just yanked into search prompt
 with string killed before it.
Type C-q to quote control character to search for it.
Type C-x 8 RET to add a character to search by Unicode name, with completion.
C-g while searching or when search has failed cancels input back to what has
 been found successfully.
C-g when search is successful aborts and moves point to starting point.

If you try to exit with the search string still empty, it invokes
 nonincremental search.

Type M-s c to toggle search case-sensitivity.
Type M-s i to toggle search in invisible text.
Type M-s r to toggle regular-expression mode.
Type M-s w to toggle word mode.
Type M-s _ to toggle symbol mode.

Type M-s SPC to toggle whitespace matching.
In incremental searches, a space or spaces normally matches any whitespace
defined by the variable `search-whitespace-regexp'; see also the variables
`isearch-lax-whitespace' and `isearch-regexp-lax-whitespace'.

Type M-s e to edit the search string in the minibuffer.

Also supported is a search ring of the previous 16 search strings.
Type M-n to search for the next item in the search ring.
Type M-p to search for the previous item in the search ring.
Type C-M-i to complete the search string using the search ring.

Type M-% to run `query-replace' with string to replace from last search string.
Type C-M-% to run `query-replace-regexp' with the last search string.
Type M-s o to run `occur' that shows the last search string.
Type M-s h r to run `highlight-regexp' that highlights the last search string.

Type C-h b to display all Isearch key bindings.
Type C-h k to display documentation of Isearch key.
Type C-h m to display documentation of Isearch mode.

If an input method is turned on in the current buffer, that input
method is also active while you are typing characters to search.
To toggle the input method, type C-\.  It also toggles the input
method in the current buffer.

To use a different input method for searching, type C-^,
and specify an input method you want to use.

The above keys, bound in `isearch-mode-map', are often controlled by
 options; do M-x apropos on search-.* to find them.
Other control and meta characters terminate the search
 and are then executed normally (depending on `search-exit-option').
Likewise for function keys and mouse button events.

If this function is called non-interactively with a nil NO-RECURSIVE-EDIT,
it does not return to the calling function until the search is done.
See the function `isearch-mode' for more information.

4 参考

著者: clothoid

Created: 2022-08-27 Sat 17:03

Validate