您可以通过使用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