I have heard of Emacs and Vim a long time ago. Some time ago, I used Vim for 4 or 5 months. I feel that it is really easy and fast to name. I recently remembered another Emacs, so I went to learn about it. After all, I could have my own comments if I had experienced it.
I encountered a problem when installing emacs23.3: Emacs: cannot open termcap database file, check the information found that because ncurses is not installed, enter sudo apt-Get install libncurses5-dev installation under Ubuntu, then make distclean and reinstall it.
Basic operations
Unlike vim, emacs needs to switch between different modes, so it has a large number of shortcut keys for operations other than text editing. In this article, we use the style in the Emacs document, C-instead of Ctrl, M-instead of ALT.
C-F: The next character, the first character of C-B, the next line of C-N, the first line of C-P, the beginning of C-A to the line, and the end of c-e to the end of the line, m-F: The next word, the first word before m-B, M-A to the beginning of the sentence, m-e to the end of the sentence, M-<to the beginning of the article, M-> to the end of the article.
Repeat a command, such as executing a C-n5: C-U 5 C-N, or M-5 C-n
Delete from the cursor position to the end of the line character: c-k, delete from the cursor position to the end of the paragraph: M-K
Cut a continuous character: C-@ at the beginning of the continuous character, C-W at the end
Paste: C-y. M-Y: paste the previous cut content in sequence
Undo: C-x u or C-_. You cannot undo the operation without changing the text.
Flip down: C-V, flip up: M-V
Ii. File and buffer zone
C-x C-F: Enter the file name to search for the file. If the file does not exist, create a new file.
C-x C-s saves the file. If the file name is specified when the file is opened, ~
C-x s checks whether there are unsaved files
Open files are stored in the buffer, C-x C-B displays buffer information, C-x B switches between buffers, and C-x K closes the current buffer.
Three windows
C-x 2 horizontal split current window, C-x 3 Vertical Split current window, C-x 1 close other windows, only show the window where the cursor is located; C-x 0 close the current window, c-x O switches between windows.
4. Compile
M-x compile, and then enter the compiled command.
Five securecrt and Emacs Problems
When Emacs is used under securecrt, the Alt key is invalid. One solution is to select use ALT as meta key in session option-> terminal-> emulation-> Emacs of securecrt.
Http://siliangdu.tk/2011/12/116)