Emacs觀念
參考 Learning GNU Emacs
Major Mode
- 一次只能有一個
- 主要針對不同語言
- Example
- Fundamental Mode
- Text Mode
- C Mode
- Lisp Mode
Minor Mode
- 相關功能
- Example
- Abbrev Mode
- 能自訂簡寫,並由emacs自動展開
add-global-abbrev
- Fill Mode
- 文字超出空間時自動換行(加上
\n)
- 文字超出空間時自動換行(加上
- Auto-save Mode
- 產生自動儲存檔(名為
#檔名#) - 用
revert-buffer指令將檔案還原成自動儲存時的狀態
- 產生自動儲存檔(名為
- Abbrev Mode
最常用的指令是 C-[something],次常用的指令是 M-[something],更不常用的指令是 C-x [something],更不常用的指令是 C-c [something]
C-u 4 [command]: 重複4次
C-u 1 6 [command]: 重複16次
M--, C-- : negative-argument
搜尋
- Incremental Search(每輸入一個字元,就尋找符合的文字)
- Non-Incremental Search(輸入完畢後才開始尋找,
nonincremental-search-forward) - Word Search(找一個字,例如找hat,不會找到that,
word-search-forward)
正規表示式搜尋
\<字首\>字尾
拼字檢查
M-$檢查目前所在單字ispell-buffer,ispell-regionM-xispell-change-dictionary
參考資料
- https://ashok-khanna.medium.com/introduction-to-dired-mode-91cecd3a06ff
- https://www.emacswiki.org/emacs/DiredMode
- https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html