Add minor-mode-specific snippets & company-dict dictionaries
This commit is contained in:
parent
cc6dee6c99
commit
22e3baf184
2 changed files with 16 additions and 1 deletions
|
@ -86,7 +86,14 @@
|
||||||
|
|
||||||
|
|
||||||
(def-package! company-dict
|
(def-package! company-dict
|
||||||
:commands company-dict)
|
:commands company-dict
|
||||||
|
:config
|
||||||
|
;; Project-specific dictionaries
|
||||||
|
(defun +company|enable-project-dicts (mode &rest _)
|
||||||
|
(if (symbol-value mode)
|
||||||
|
(push mode company-dict-minor-mode-list)
|
||||||
|
(setq company-dict-minor-mode-list (delq mode company-dict-minor-mode-list))))
|
||||||
|
(add-hook 'doom-project-hook '+company|enable-project-dicts))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -25,6 +25,14 @@
|
||||||
yas-prompt-functions '(yas-completing-prompt yas-ido-prompt yas-no-prompt)
|
yas-prompt-functions '(yas-completing-prompt yas-ido-prompt yas-no-prompt)
|
||||||
yas-snippet-dirs '(yas-installed-snippets-dir))
|
yas-snippet-dirs '(yas-installed-snippets-dir))
|
||||||
|
|
||||||
|
;; Allows project-specific snippets
|
||||||
|
(defun +snippets|enable-project-modes (mode &rest _)
|
||||||
|
"Enable snippets for project modes."
|
||||||
|
(if (symbol-value mode)
|
||||||
|
(yas-activate-extra-mode mode)
|
||||||
|
(yas-deactivate-extra-mode mode)))
|
||||||
|
(add-hook 'doom-project-hook '+snippets|enable-project-modes)
|
||||||
|
|
||||||
;; fix an error caused by smartparens interfering with yasnippet bindings
|
;; fix an error caused by smartparens interfering with yasnippet bindings
|
||||||
(advice-add 'yas-expand :before 'sp-remove-active-pair-overlay)
|
(advice-add 'yas-expand :before 'sp-remove-active-pair-overlay)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue