Home
GNU Emacs
編 輯 器
Emacs / XEmacs Quick Reference 速 成 表
Linux Command
企 鵝 指 令
Filesystem
檔 案 系 統
Restart
重 新 啟 動
Kernel Compilation
編 譯 系 統 核 心
網 路 小 品
企 鵝 巧 手
Linux Link
企 鵝 網 址
自 言 自 語

GNU Emacs Editor
GNU Emacs 編 輯 器


Introduction

  • Emacs stand for EditorMACroS.
  • Emacs creates a backup file when you save an existing file, ~ character appended to the end of the name.
  • The shift key is meaningless with control characters.
  • 按鍵指令沒有大小寫分別
  • Emacs assigns meanings to named commands, and then gives keys their meanings by binding them to command.
  • Every command has a name chosen by a programmer. The name is usually made of a few English words separated by dashes; for example, next-line or forward-word. A command also has a function definition which is a Lisp program; this is what makes the command do what it does. In Emacs Lisp, a command is actually a special kind of Lisp function;
  • The bindings between keys and commands are recorded in various table called keymaps.
Return 返回

Execute a shell within Emacs 執行 Shell 指令

  1. Press C-u ESC !
  2. You are prompted to enter a shell command
  3. Enter the command and press RET
  4. If, do not press C-u, Emacs places the output into a buffer/window called *Shell Command Output*
  5. To delete the output window, press C-x 1.
Return 返回

Conventions 說明

These Emacs commands are actually shortcuts for the full text commands which place inside the blanket.
  • "C-" means use the CTRL Key
  • "M-" means use the META (or ALT) key. If you have no META key, you may instead type ESC followed by the character.
  • "RET" means RETURN or ENTER key
  • "ESC" means ESC key
  • "BS" means Backspace key
  • "DEL" means Delete key
  • "SPC" means Spacebar
  • "F1" - "F10" mean correspond function key
Return 返回

Invoke Emacs 執行 Emacs

Command
指令
Descriptions 解說
emacs  
emacs filename  
Return 返回

Exiting Emacs 離開

Key Sequence
按鍵
Descriptions 解說
C-z Suspend Emacs (suspend-emacs) or iconify a frame (iconify-or-deiconify-frame). 暫停,回到命令列
%emacs Resume Emacs 喚醒
C-x C-c Kill Emacs (save-buffers-kill-emacs). 離開
Return 返回

Help 說明

Key Sequence
按鍵
Descriptions 解說

C-h

Help 說明
F1 Help 說明
C-h t Emacs Tutotial (help-with-tutorial) 使用教學
C-g Cancel the command 取消執行指令
ESC ESC ESC Cancel the command 取消執行指令
F10 Menu Bar 功能表
ESC ` Menu Bar 功能表
M-` Menu Bar 功能表
Return 返回

Files Handling 檔案

Key Sequence
按鍵
Descriptions 解說
C-x C-f Create an empty buffer and read the file contents (if exist) to the buffer (find-file) 開啟檔案
C-x C-s Saves current buffer to disk (save-buffer) 儲存檔案
Return 返回

Moving the Cursor Point 移動游標

Key Sequence
按鍵
Descriptions 解說
C-a Move to the beginning of the line (beginning-of-line) 移到行頭
C-e Move to the end of the line (end-of-line) 移到行尾
M-a Move to the beginning of the sentence 移到句首
M-e Move to the end of the sentence 移到句尾
C-f Move forward one character (forward-char) 往前移動一個字元
C-b Move backward one character (backward-char) 往後移動一個字元
M-f Move forward one word (forward-word) 往前跳動一個字
M-b Move backward one word (backward-word) 往後跳動一個字
C-n Move down one line, vertically (next-line). This command attempts to keep the horizontal position unchanged, so if you start in the middle of one line, you end in the middle of the next. When on the last line of text, C-n creates a new line and moves onto it 向下移動一行
C-p Move up one line, vertically (previous-line) 向上移動一行
M-r Move point to left margin, vertically centered in the window (move-to-window-line). Text does not move on the screen. 移到左中行
C-v Move forward one screen 翻下一頁
M-v Move backward one screen 翻上一頁
M-< Move to the top of the buffer (beginning-of-buffer). With numeric argument n, move to n/10 of the way from the top. 移到檔頭
M-> Move to the end of the buffer (end-of-buffer) 移到檔尾
C-l Clear screen and redisplay all the text, moving the text around the cursor to the center of the screen 重畫螢幕,游標連文字移到中行
Return 返回

Editing Text

Key Sequence
按鍵
Descriptions 解說
C-o Insert one or more blank lines after the cursor (open-line)
BS Delete the character before point (delete-backward-char) 刪除游標往後的一個字元
DEL Delete the character after point (delete-char) 刪除游標目前指的字元
C-d Delete the character after point (delete-char) 刪除游標目前指的字元
C-k Kill to the end of the line (kill-line) 刪除至行尾
M-d Kill forward to the end of the next word (kill-word) 往前刪除一個字
C-x C-o Delete all but one of many consecutive blank lines (delete-blank-lines) 刪除空行
Return 返回

Undo 復原

Key Sequence
按鍵
Descriptions 解說
C-x u Undo one batch of changes--usually, one command worth (undo) 復原最近一次指令
C-_ (undo) 復原最近一次指令
C-u C-x u Undo one batch of changes in the region
Return 返回

Repeating a Command 重復

Key Sequence
按鍵
Descriptions 解說
C-x z (repeat) 重復
C-x z z The first C-x z repeats the command once, and each subsequent z repeats it once again 再次重復
Return 返回

Key Sequence bind to Menu Bar Command

Menu
功能表  
Key Sequence
按鍵
Menu Bar 功能表
Files 檔案 C-x C-f Open File 開啟檔案
  C-x d Open Directory 開啟目錄
  C-x C-w Save Buffer as 另存新檔
  C-x i Insert File 插入檔案
  C-x 5 2 Make New Frame 開新框架
  C-x 2 Split Window 分割視窗
  C-x 1 One Window
  C-x C-c Exit Emacs 離開
Buffers
緩衝區
C-x C-b List all Buffers 列出緩衝區清單
Edit C-_ Undo 復原
  C-w Cut 剪下
Return 返回

未完待續
本 頁 最 後 更 新 日 期 :2002年02月20日