Emacs Getting Started (2)

zhaozj2021-02-16  56

The previous has introduced how to open, save the file, this time we will first introduce how to move the cursor in the document (the cursor is represented in the EMACS term).

You can move the cursor in Emacs, but this does not meet the design philosophy of Emacs "Hand Non-Key Keyboard", so it designs the category cursor mobile method.

The simplest movement is of course the upper and lower, the corresponding key is CP, CN, CB, CF. For convenience of memory, please remember that PNBF is the abbreviation of Previous Line, Next Line, Backward and Forward, please try to press several times , Practice, make sure you are skilled.

Secondly, it is turned on, usually you can use and , but Emacs shortcuts are CV and MV, note that there is another new representation, MV, it means that key is not Put, press the V key. What is the button? Oh, for most PC keyboards key is the key. You can open a long article, you can press CH T to open Emacs's Tutorial to practice, don't worry, accidentally chaos it, you open Turtoial is just a copy, even if it is changed, Opening is also a new version that has not changed.

C-A and C-E can move the cursor to the end of the cursor, which is equivalent to and .

If you change the CTRL key of the above command to the Alt key, their function changes: MB, MF, MA, ME indicate a word forward movement, move one word, move to the current sentence first character and movement Last character to the current sentence. In this way, the CTRL key is used for "physical" moving cursor, in line as a line, and the ALT shift is used to move the cursor, the unity of the words, sentences, etc.

If you want to move a number of units once, you can add numeric parameters to the command. By the C-U command, such as: C-U 8 C-N is indicated to the down shift 8 rows, C-U 10 m-E indicates the 10 sentence. However, the parameters of the C-U have specially speaking on the C-V and M-V commands. It does not represent how many pages up and down, but it means how many rows of rolling up and down. Note that the difference from C-N, C-U 8 C-N indicates that the cursor is shifted down, and the screen does not necessarily scroll, and the C-U 8 C-V indicates that the screen scrolls 8 rows. If the cursor does not roll outside the screen, the cursor position is unchanged.

As mentioned earlier, use C-G to interrupt the current command. This time, then add a little, sometimes the C-G is inseparable, and can press the three keys to reach the same purpose.

Then introduce two common but not very good commands, M- , because the symbols are in, and. Above, actually press ALT SHIFT , and Alt SHIFT . These two commands are used to move the cursor to the position and end of the file.

I have learned a lot of things, easily, can play some games from Emacs, they can find in the Tools menu Games, if you know the name of the game, you can call directly to call, first press MX, Then you can enter any legal commands. If you want to play gregares, you can enter the snake command. In fact, all of EMACS has a corresponding command name, including various shortcuts above and the upcoming introduction, such as the CX CS save file, the corresponding command is Save-buffer, you can type MX, then enter Save-buffer Perform the same function as the CX CS, which is very useful in the case of forgetting the shortcut. Similarly, if you remember the shortcut but not know the corresponding command name, you can press the relevant help by pressing the C-H C-K and pressing the corresponding shortcuts. Remember, Emacs's help is very detailed, I printed an Emacs manual, a total of more than 500 pages, covering each detail of the Emacs operation. Below we have to introduce, if you complete the undo, cut, copy, and paste operations in Windows.

Undo is the simplest, shortcuts are C-_, similarly, because _ symbols are on the standstall, so press the SHIFT key operation, if you think this is inconvenient, you can use C-X u, functionality. Also you can use a digital parameter with C-U before c-_ to undo multiple steps at a time.

To select a piece of area in Emacs, you can move the cursor to the start or end position of the area, press C- or C - @ (the former may be switched in Windows, so it can only be used I don't forget to press the SHIFT button in the same way. At this time, Emacs will prompt the Mark Set, and then move the cursor to the end position. Under normal circumstances, there will be no reflection logo on the screen says a zone. But it does have selected this area.

At this time, press CW to remove the selected area KILL, which is equivalent to the cutting operation we are in Windows, and the two words in Emacs delete and kill are all meaningful, the former often refers to deletion, only It can be recovered by cancellation operation, and the latter is equivalent to cut, and can be recovered by a certain method. In addition, the shear in Emacs is different from traditional Windows, which is more like a new version of Office clipboard, which can be stored multiple copies or cut.

To restore the content of the last kill, press C-Y, press Multiple Take Multiple YANK's last KILL content, which is equivalent to multi-touch in Windows. If you want Yang Kill's content a few times, you can press the M-Y key repeatedly.

To achieve the same functionality with Windows, press the M-W key after the selected area, which will put the selected content into Kill-Ring so that YANK is later, but does not truly kill the selected content.

With the above content, you basically can use the Emacs as a tool that is almost much with Windows NotePad, and we will continue to tell later.

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

New Post(0)