Emacs Getting Started Guide (3)

xiaoxiao2021-03-06  120

With the learning of the first two articles, you can already use Emacs as a better-notepad. Today we have to learn is a powerful search function in Emacs. By default, Emacs uses a very good "incremental search" function, although it is very different from our common search methods in operation habits, but it is indeed very convenient after habits. To let Emacs start to perform a search, press C-S or C-R, the former is looking for afterwards from the cursor position, and the latter is looking forward. We take C-S as an example. After pressing CS, Emacs Tips in Minibuffer: I-Search:, you can enter the keyword to search. Now, now I suggest that you will get slower when you enter, see how Emacs is doing you Search request. For example, you want to search for the word "search", you enter S, then Emacs move the cursor to the latest S letter, here you have paused for a while, Emacs will highlight all S letters. You continue to enter E, at this time, Emacs found the nearest SE letter combination. I have been entering until Emacs finds the content you are looking for, then press Enter to end the lookup. During the lookup, you can repeatedly press C-S or C-R to perform backward or forward lookups. If you have already found a matching content, and press the Enter key to end the lookup, then you want to find this content, you only need to press CS or CR, first press to activate the lookup Function, while the second press is to continue looking up. When entering the lookup key, if you accidentally lose the wrong, you can press the key to clear the previous character. Please note that in Emacs terms, the key refers to the keys we usually said. And the key represents the or key on our keyboard. There is also a detail when entering keywords. If you enter the keywords you enter English small letters, Emacs will perform uncounting lookups. However, if the keyword entered in the keyword contains uppercase letters, Emacs will look for case-sensitive lookups. In addition, in the process of finding, you can switch the distinguished size word mode through the M-C shortcut, which can be used to force whether the case is case sensitive. If you don't want to use Emacs's incremental search capabilities, you can also make the traditional search. After pressing CS or CR, you can play a key to the key, at this time, Emacs will make non-increasing search, you can enter your Keywords, press Enter to perform search. The following is a more powerful regular expression search function. You can initiate a forward or reverse regular expression search function by pressing C-M-S or C-M-R, and Emacs will prompt RegexP I-Search in Minibuffer:, then you can enter the regular expression that is about to match. A lot of control symbols can be used in regular expressions. Here I pick several commonly used simple introductions, more comprehensive and complicated interprets can be found in Emacs's manual. '.' (Journal): The second sentence number of the regular expression can be used to match an arbitrary character. For example, regular 'a.b' can match ABB, ACB, ADB. . . Wait with a string of three characters ending with B. '*': The * number in the regular expression can be used to indicate that the characters before it repeats 0 times or more. For example, 'ff *' can match one or more connected strings.

转载请注明原文地址:https://www.9cbs.com/read-125781.html

New Post(0)