版權聲明

所有的部落格文章都可以在右邊[blog文章原始檔案]下載最原始的文字檔案,並依你高興使用 docutil 工具轉換成任何對應的格式方便離線閱覽,除了集結成書販賣歡迎任意取用,引用

Emacs rst-mode

安裝

  • rst.el 另存新檔rst.el到emacs的收尋路徑
  • 在.emacs中加入
(require 'rst)
(setq auto-mode-alist
(append '(("\\.txt$" . rst-mode)
      ("\\.rst$" . rst-mode)
      ("\\.rest$" . rst-mode)) auto-mode-alist))

Local variables

假如 (set enable-local-variables t) 將下面敘述放在第一行可以觸發rst mode

.. _*_ mode: rst -*-

或是下面放檔案最後

..
Local Variables:
mode: rst
End:

Section 快捷

在title下面輸入C-- or C-=:

Title1
^^

查看目前Section hierarchy:

M-x rst-display-decorations-hierarchy [C-c C-h]

Move to pre section:

M-x rst-backward-section [C-c C-p]

Move to next section:

M-x rst-forward-indented-block [C-c C-n]

Mark section:

M-x rst-mark-section [C-c C-m]

Config

Indent設定:

(setq rst-default-indent 4)

Block

先mark要作用的區域

智慧右移:

M-x rst-shift-region-right [C-c C-r]

智慧左移:

M-x rst-shift-region-left [C-c C-l]

自動bullet list:

M-x rst-enumerate-region [C-c C-e]

Line Block:

Apples
Oranges
Bananas

M-x rst-toggle-line-block [C-c C-d]::

| Apples
| Oranges
| Bananas

Compile

M-x rst-compile [C-c 1]

沒有留言:

Related Posts with Thumbnails