Find and replace are features that are indispensable to any editor.
Input >> Notice >> input >> quit >> output
Active region, or cursor point to end.
Marked files in dired.
Active region >> c-r >> php >> RET >> c-g OR ESC ESC ESC
What is recursive editing state???
Recursive editing state, simply said that you in the process of looking for replacements suddenly found that need to modify something, but do not want to directly exit the search and replace, then Emacs provides a temporary editing state can let you first think of things, and when you have finished can also go back to find the replacement state, This temporary state is called recursive editing state.
Emacs divides the search into four large categories: Simple lookup, incremental lookup, phrase lookup, and regular lookup. Each of the four methods have characteristics, the scope of application is also different, we are familiar with the needs of one or two.
Mark ring kill ring Search ring
1. C-s >> s >> c-s OR c-r
2. C-s >> s >> m-c >> c-s OR c-r
3. C-s >> C-j
4. C-s c-s OR c-r c-r
C-s, Mini buffer will appear i-search, enter the word you want to find, as you enter the character increase increment highlight, find the word you want, type enter--c-s command to toggle the position of the word
C-s Isearch-forward starts from the cursor position (toward the end of the file) increments the lookup
C-r Isearch-backward from the cursor position (toward the head of the file) increments the lookup
C-s C-w A word starting at the cursor position as a lookup string
C-s c-y from the cursor position to the end of the line as a lookup string
Return Exit Lookup
C-g keyboard-quit Cancel Incremental lookup (press two times)
M-s w ret words ret (word-search-forward)
M-s W c-r ret words ret (word-search-backward)
------------------------------------
I-search
I-search-backward
Search
Word I-search
Word Search
I-search-regexp
I-search-backward-regexp??? It's not going to work.
Two. Replace
Note: Is the forward lookup replacement
M-x replace-string
M-x Replace-regexp
m-% Query-replace
c-m-% Query-replace-regexp
Search and replace for Emacs