M-a | Move to start of sentence. *
M-e | Move to end of sentence. *
* Only works if 2 spaces follow/precede sentence.
| Cut (Kill), Copy, & Paste (Yank)
To Cut or Copy text you need to set a "Mark" and a "Point". Move the cursor to a particular position and press C-Space to set the Mark. The Point is just the position of the cursor so move it one space beyond where you want to Cut or Copy.
"region"
<------------>
M P
M=Mark (Set with C-space)
P=Point (Cursor position)
| C-w | Cut (Emacs terminology: "kill the region").
| C-k | This Cuts but you don't set a Mark to use it. Move the cursor somewhere, and whilst holding down the Ctrl key, tap away at the k key. Now move somewhere else and press Ctrl+y. Note that when you use repitition (e.g. C-u 5 C-k) you don't need to take the cutting of the newline characters into account. The best way of understanding this command is to play about with it for a few minutes.
|
| M-w | Copy.
|
| C-y | Paste (Emacs terminology: "yank text into buffer").
| M-y | After you paste some text you can replace with text you've previously cut or copied it by cycling backwards through all the text you've cut or copied.
|
| Save, Open (Find), & Exit
When you first save a modified document in Emacs, the original file will be saved as ~filename in case you ever want to revert back to it. Emacs will also autosave your document in case of power loss, a crash etc, giving the autosaved file the name #filename# and delete the file every time you save the document. To recover a file, open the normal file (not the autosaved file) and enter: M-x recover file.
| C-x C-s | Save current buffer to file.
| C-x C-w | Save current buffer as...
| C-x s | If you had many buffers open, it would be annoying if you had to swap to each before saving them. This will ask in turn, ask which you want to save.
|
| C-x C-f | Open (Emacs Terminology: "find") a file into a new buffer (filename completion available with Tab key). By opening a file that doesn't exist, you start a new named document. And by opening a file that's already open you switch to it.
| C-x d | Browse your Linux filesystem. Either press Enter or the middle mouse button (both together on a 2 button mouse) to open a file or move to another directory.
| C-x i | Insert contents of another file at cursor.
|
| C-x C-c | Exit Emacs. (Note: In console mode you could also suspend Emacs with Ctrl+z, do something else, then bring it back with: fg (In X, Ctrl+z will just minimise the window.))
|
| Search & Replace
C-s | Enter isearch mode. Type the word, word completion will take place and Emacs will jump to the next word that starts with what you've entered. Press C-s for next occurence. (Document wrap takes place.)
| C-r | Same as C-s but search occurs in reverse direction.
|
| M-% | Replace...
|
| Buffers/Windows
C-x 1 | Maximise current buffer.
| C-x 2 | Switch current buffer into 2. (Use: C-x o ("o" for "other") to switch from top to bottom.)
| C-x 5 2 | Open current buffer in new frame.
| C-x b | Switch to another buffer.
| C-x C-b | List buffers.
| C-x k | Kill a buffer. Press Enter to kill the current buffer or enter the name of another buffer to kill. The name of a buffer is the filename minus the path.
|
| Undo & Redo
C-x u | Undo (infinite).
| C-_ | " "
|
| Help
C-h k key combo | Display documentation for key combo.
| C-h ? | Display list of types of help and how to access them.
|
| Repitition
Vi has it and Emacs has it. It's one of the things that seperates Unix/Linux editors from the Windows crop. To repeat a command in Emacs press Ctrl+u, followed by the amount of times to repeat an operation, and finally the operation itself. Here's some examples:
| C-u 30 = | Insert 30 "="s at cursor.
| C-u 10 [Down Cursor] | Move cursor down 10 lines.
| C-u 3 C-x u | Undo 3 times.
|
| Miscellaneous
C-g | Cancel half way through just about anything. Very handy.
|
| [ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
| * In Linux enter: unzip nlm.zip
| Homepage | The Last 5 Days | The Daily Linux News | The Linux Bits | Newbie's Linux Manual The Best Linux Sites | Linux Book Reviews | A Windows Vendetta? Diary of a Linux Newbie | Diary of an Open Source Newbie The Linux Forum | Just For Fun
| 4.7 million books, CDs, videos, and DVDs available to buy!
| © MM Linuxdot.org | Webmaster | Manual's Copyright Terms
| | | | | | | | | | | | | | |