各位好,我尝试写一个DSL的私有层,并且加上编译的键位绑定,不过貌似spacemacs/set-leader-keys-for-major-mode
一直没有效果。下面是我的代码,主要就是键位绑定的那几行。我看官方的文档和别人的一些私有层的键位绑定都是这样写的,是我哪里搞错了呢?
(defconst graphviz-packages
'(
company
graphviz-dot-mode
))
(defun graphviz/init-graphviz-dot-mode ()
(use-package graphviz-dot-mode
:mode ("\\.dot$" . graphviz-dot-mode)
:defer t
:config
(progn
(spacemacs|add-toggle graphviz-live-reload
:status graphviz-dot-auto-preview-on-save
:on (graphviz-turn-on-live-preview)
:off (graphviz-turn-off-live-preview))
(push 'company-capf company-backends-graphviz-dot-mode)
(spacemacs/set-leader-keys-for-major-mode 'graphviz-dot-mode
"t" 'spacemacs/toggle-graphviz-live-reload
"c" 'compile
"p" 'graphviz-dot-preview
"," 'graphviz-dot-preview))))
(when (configuration-layer/layer-usedp 'auto-completion)
(defun graphviz/post-init-company ()
(spacemacs|add-company-hook graphviz-dot-mode)))