特定于文件类型的Emacs快捷方式 [英] Emacs shortcuts specific for a file type
本文介绍了特定于文件类型的Emacs快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 F12 进行编译。它运行
make -f
。我想要运行 F12
Mx org-export-as-html
当我在组织模式时。
我该如何编辑我的.emacs文件?目前只是:
(global-set-key [f12]'compile)
谢谢,
hamen
解决方案
添加模式挂钩对于使用 local-set-key
而不是 global-set-key
(add-hook'org-mode-hook(lambda()(local-set-key [f12]'org-export-as- html)))
is there a way to get different shortcut for different file types?
Tipically I use F12 to compile. It runs make -f
. I'd like to have F12 running
M-x org-export-as-html
when I'm on Org-mode.
How should I edit my .emacs file? Currently it's just:
(global-set-key [f12] 'compile)
Thanks,
hamen
解决方案
Add a mode hook for org-mode that does a local-set-key
instead of a global-set-key
(add-hook 'org-mode-hook (lambda () (local-set-key [f12] 'org-export-as-html)))
这篇关于特定于文件类型的Emacs快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文