Home > Tech | emacs > Emacs Again (6): Learning GNU Emacs Chap 2

Emacs Again (6): Learning GNU Emacs Chap 2

Here’s a list of commands I learned from Learning GNU Emacs, Third Edition Chapter 2.

Chpater 2 — Editing

Key Stroke Command Name Action
C-x Control-X-prefix Try C-h v and type ctl-x-map
M-x execute-extended-command Run a function by name. Try C-h f for each specific function name and what it does.
C-f forward-char Move point one character right
C-b backward-char Move point one characer left
C-p previous-line Move point vertically up
C-n next-line Move point vertically down
M-f forward-word Move point forward by a word
M-b backward-word Move point backward by a word
C-a move-beginning-of-line Move point to beginning of current line as displayed
C-e move-end-of-line Move point to end of current line as displayed
M-a backward-sentence Move point backward to start of sentence
M-e forward-sentence Move point forward to next "sentence-end". (The variable "sentence-end" is a regular expression)
M-} forward-paragraph Move point forward to end of paragraph
M-{ backward-paragraph Move point backward to start of paragraph
C-x ] forward-page Move pointforward to page boundary
C-x [ backward-page Move point backward to page boundary
C-q quoted-insert Read next input character and insert it. This is useful for inserting control characters. For example, if you want to insert \?, you'll type C-q DEL
C-v scroll-up Scroll text of current window upward
M-v scroll-down Scroll text of current window down
M-> end-of-buffer Move point to the end of the buffer; leave mark at previous position.
M-< beginning-of-buffer Move point to the beginning of the buffer; leave mark at previous position.
M-g M-g goto-line Goto line ARG, counting from line 1 at beginning of buffer.
  goto-char Set point to POSITION, a number or marker.
M-(number) digit-argument Repeat following command (number) times. For example: M-3 C-f will move point 3 characters forward.
C-u universal-argument Begin a numeric argument for the following command. For example: C-u 9 C-q DEL will insert nine \? at point, C-u 3 C-f will move point 3 chars forward.
C-l recenter Center point in window and redisplay frame.
C-d delete-char Delete the following character. Defaultly assigned on delete button
M-d kill-word Kill characters forward until encountering the end of a word.
M-DEL backward-kill-word Kill characters backward until encountering the beginning of a word
C-k kill-line Kill the rest of the current line; if no nonblanks there, kill thru newline.
C-y yank Reinsert ("paste") the last stretch of killed text.
C-SPC or C-@ set-mark-command Set the mark where point is, or jump to the mark.
C-x C-x exchange-point-and-mark Put the mark where point is now, and point where the mark is now
M-h mark-paragraph Put point at beginning of this paragraph, mark at end
C-x h mark-whole-buffer Put point at beginning and mark at end of buffer
C-x C-p mark-page Put mark at end of page, point at beginning
M-y yank-pop After C-y, Rotate Kill Ring. Let's say, you have ['latest', '2nd', '3rd'] as Kill Ring. When you do C-y, Emacs inserts latest at point. Then M-y will change latest to 2nd, and type M-y again, 2nd will be 3rd. M-y again, 3rd will be back to latest.
C-t transpose-chars Interchange characters around point, moving forward one character
M-t transpose-words Interchange words around point, leaving point at end of them
C-x C-t transpose-lines Exchange current line and previous line, leaving point after both
C-g keyboard-quit Signal a quit condition.
C-x u advertised-undo Undo some previous changes

Notes

Like other editors in Mac/Windows or even in vi… You know, when you start to select characters, background and foreground colors are inverted. In order to visualize where you are selecting (in Emacs way, it should say… make a region by using set-mark command), you have to add the following line in your .emacs.el. I just wonder why this is not default configuration… Anyway.

(setq-default transient-mark-mode t)

I’ve started my unix career with vi, like 1997? Even the first information technology class in my college taught me to use emacs, I liked vi better because, in that class, I think we have around 100 ~ 200 students one class, and all of them were connecting to “Clay Super Computer” with a few giga-bytes of memory space… It was just insane, to use a “memory sucker Emacs” with that terminal.

So, I still, when I did something wrong on editor, I type ESC! ESC! ESC!.. but instead, I should start to do C-g! C-g! C-g!!

Clipboard-Pasetboard interoperability/synchronization doesn’t work in my environment, Mac OS X 10.5 with Terminal Emacs 22.1.

Changing capital, Overwrite and Customization doesn’t seem to be important to me so I skipped it for now.

Comments:0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://blog.nydd.org/2009/04/emacs-again-6-learning-gnu-emacs-chap-2/trackback/
Listed below are links to weblogs that reference
Emacs Again (6): Learning GNU Emacs Chap 2 from Vantage Point of Queens

Home > Tech | emacs > Emacs Again (6): Learning GNU Emacs Chap 2

Search
Feeds
Meta
Links
Ads!

Return to page top