RSI 2000

The 2001 Research Science Institute



 RSI 2000 Home > Help Me! > FAQ > Emacs



Emacs FAQ

1. How do I undo?
2. How do I cancel a command in the middle of typing it?
3. How do I go to a specific line?
4. How do I do a search?
5. How do I do search-and-replace?
6. How do I insert one file into the middle of another?
7. How do I reformat a paragraph of text in emacs to have consistent margins?
8. What are some useful commands to move the cursor around?
9. How do I get pretty syntactic highlighting for my code?
10. How do I cut/copy/paste in emacs?
11. When I try to do C-x C-s or C-x C-c nothing happens. Why?
12. I can't stand that my LaTeX files are color coded. How do I get rid of this?

1. How do I undo?

C-_ or C-x u

2. How do I cancel a command in the middle of typing it?

C-g

3. How do I go to a specific line?

M-x goto-line RET # RET

4. How do I do a search?

C-s

5. How do I do search-and-replace?

M-%

6. How do I insert one file into the middle of another?

Go to where you want to insert the file, then C-x i filename RET

7. How do I reformat a paragraph of text in emacs to have consistent margins?

M-q

8. What are some useful commands to move the cursor around?

Begin line C-a
End line C-e
Down line C-n
Up line C-p
Scroll down C-v
Scroll up M-v

9. How do I get pretty syntactic highlighting for my code?

M-x font-lock-mode

10. How do I cut/copy/paste in emacs?

Go to the beginning of the region and hit C-space. Go to the end, and type C-w to cut or M-w to copy. Go to the destination, and type C-y to paste.

11. When I try to do C-x C-s or C-x C-c nothing happens. Why?

If you are telnetting from a Macintosh, the problem is that the telnet program is intercepting the keystrokes. Disable that (how to do this varies by program). If you are not telnetting from a Macintosh, zephyr rsi-help.

12. I can't stand that my LaTeX files are color coded. How do I get rid of this?

Edit your ~/.emacs file (emacs ~/.emacs). Remove (or comment out, by placing a ;; at the beginning of each line) everything beneath "turn on font-lock-mode." You won't ever see the color coding again, unless you turn it back on.