emacs(gui) 的基礎指令

此筆記用途在於我學習中用到的指令
並非所有人都適用,部分對我而言稍加容易的內容並不會寫在此內。

基礎指令

  • DEL 可直接刪除字元
  • ctrl-u <number> <char> 將此單字複製多次
  • ctrl-u <number> <command> 重複特定指令
    • ctrl-u 2 ctrl-k 刪除兩行
  • ctrl-space 可以將一段範圍選取,可再搭配特定命令進行操作
    • ctrl-w 移除特定字元(當刪除字元時會完整刪除,不留下 space),若刪除 space 則無異議
  • ctrl-k 從定位點,刪除到行尾
  • ctrl-y 貼上
    • 可將上一次進行刪除的字串,做復原
  • ctrl-y alt-y 回復倒數第二次被刪除的字串
    • 如果需要回復更早,則輸入更多 alt-y
  • ctrl-/ 回到上一步
  • esc esc esc 當你不需要這個指令 or 打錯,則使用這個指令

進階指令

  • ctrl-x ctrl-f 查看目錄檔案
    • ctrl-x ctrl-f <file_name, options> 新建檔案,可以輸入 filename 來決定此檔名。
  • ctrl-g 終止當前動作
  • ctrl-x ctrl-s <file_name, options> 儲存檔案,可以輸入 filename 來決定此檔名
  • ctrl-x 1 關閉視窗
  • ctrl-x ctrl-b 查看開了哪些 buffer
  • ctrl-x ctrl-s 儲存檔案
  • ctrl-x b <buffer_name> 切換其他的 buffer,同時開個新視窗
  • ctrl-x ctrl-x 儲存每個 buffer 後,關閉 emacs
  • ctrl-z 將 emacs 切到後台
    • %emacs emacs 切回來

其他常用指令

  • meta-x repl s<return><search_string><return><replacement_string> 替換字串;其中 <return>是按 enter,另外兩個按照字面意思
  • 使檔案自動儲存
    • 則檔案前綴名必須是 #<file.filetype>#
    • 則會自動儲存,其中也可以透過 meta-x recover-file 來還原檔案
  • 倒數第二行之狀態
    • -:--- 已被儲存
    • -:**- 有資料尚未被儲存
  • meta-x <modename> 可切換其他 emacs 模式。
  • ctrl-s 搜尋,反白後則可以做其他動作
    • ctrl-r 向前搜尋
    • ctrl-s 向後搜尋
  • ctrl-x 2 開兩個視窗
    • ctrl-x o 切換視窗的 cursor
  • meta-x make-frame 再新增一個程式 emacs
  • meta-x delete-frame 刪除一個程式 emacs
  • 版權聲明: 本部落格所有文章除有特別聲明外,均採用 Apache License 2.0 許可協議。轉載請註明出處!
  • © 2020-2024 John Doe
  • Powered by Hexo Theme Ayer
  • PV: UV: