【发布时间】:2015-01-28 02:05:58
【问题描述】:
我主要使用 emacs 做笔记。我所有的笔记都在: ~/Dropbox/Uni/Notes
我想绑定一个键盘快捷键(例如 C-f12)来执行 helm-find,该 helm-find 始终在与源缓冲区无关的上述目录中开始。
我试过了:
(global-set-key (kbd "C-<f2>") (lambda () (interactive) (helm-find "~/Dropbox/Uni/Notes/")))
但是当我运行它时,它仍然提示我输入“DefaultDirectory”,它通常与当前缓冲区相同。
?
[编辑]
我做了一个修改:
(global-set-key (kbd "<C-f2>")
(lambda ()
(interactive)
(find-file "~/Dropbox/Uni/Notes/leo.org")
(helm-find nil)))
这会打开一个文件,然后当我进行 helm-find 时,它与 leo.org 的位置相关。但最好有更好的解决方案。
[编辑] 以下解决方案完美运行。
【问题讨论】:
标签: emacs elisp emacs-helm