您可以通過使用ORG-defkey定義僅適用於組織模式的關鍵,基本上添加以下到您的init文件
(org-defkey org-mode-map [f5] 'org-reveal-export-to-html)
UPDATE
您可以使用文件的局部變量。
(defvar export-with-reveal nil)
(defun export-with-reveal-or-html()
(interactive)
(if (or export-with-reveal (file-exists-p "reveal.js"))
(call-interactively 'org-reveal-export-to-html)
(call-interactively 'org-export-as-html)))
(org-defkey org-mode-map [f5] 'export-with-reveal-or-html)
功能export-with-reveal-or-html
如果變量export-with-reveal
具有值T或有一個文件「reveal.js」相對於ORG文件,如果是的話它reveal
出口也回落到默認的HTML出口。你可以指定一個文件,以出口加作爲顯示以下到您的組織文件的頂部
# -*- export-with-reveal: t -*-
更新2
您還可以通過使用文件的本地變量做定義任意輸出功能
(defvar my-export-fn nil)
(defun my-export()
(interactive)
(if my-export-fn
(call-interactively my-export-fn)
(call-interactively 'org-export-as-html)))
(org-defkey org-mode-map [f5] 'my-export)
然後在文件的頂部,你可以設置導出功能要使用如
# -*- export-fn: org-reveal-export-to-html -*-
重複[文件特定的鍵綁定在Emacs(http://stackoverflow.com/a/21493693/324105)? – phils