将定制的yasnippet目录添加到`Spacemacs`中
问题描述:
对不起,对于非常新鲜的问题,只是试图在spacemacs
中为yasnippets
配置单独的目录。我根本不熟悉emacs lisp。所以说,我可以把目录将定制的yasnippet目录添加到`Spacemacs`中
(setq-default dotspacemacs-configuration-layers '(
(auto-completion :variables
auto-completion-return-key-behavior 'complete
auto-completion-tab-key-behavior 'cycle
auto-completion-complete-with-key-sequence nil
auto-completion-complete-with-key-sequence-delay 0.1
auto-completion-private-snippets-directory nil)
))
,所以我必须设置auto-completion-private-snippets-directory
,但我不知道如何配置,如“〜/ Dropbox的/片断”自定义目录。我试着用下面的代码添加目录,但它没有工作。
dotspacemacs-configuration-layers '(
...
auto-completion-private-snippets-directory "~/Dropbox/snippets")
))
我不确定是否需要尝试将新目录推送到变量等任何建议。
答
我想出了如何做到这一点。基本上只需要追加目录到yas-snippet-dirs
变量。这些额外的目录然后被添加到yasnippet
收集片段的目录列表中。
;; Snippet configuration
(setq-default dotspacemacs-configuration-layers '(
(auto-completion :variables
auto-completion-return-key-behavior 'complete
auto-completion-tab-key-behavior 'cycle
auto-completion-complete-with-key-sequence nil
auto-completion-complete-with-key-sequence-delay 0.1
auto-completion-enable-snippets-in-popup t
auto-completion-enable-sort-by-usage t
auto-completion-enable-help-tooltip t
auto-completion-private-snippets-directory nil)
))
;; add extra snippet directories
(setq yas-snippet-dirs (append yas-snippet-dirs
'("/home/<username>/Dropbox/.../snippets")))
(setq yas-snippet-dirs (append yas-snippet-dirs
'("/home/<username>/Dropbox/.../more_snippets")))
您应该能够将您的问题标记为已解决;) – Ealhad