reddit / emacs

Yasnippet configuration issue.

eis3nheim · 2022-06-07 18:21
Trying to configure `yasnippet` (use-package yasnippet :bind (:map yas-minor-mode-map ("C-'" . yas-expand) ([(tab)] . nil) ("TAB" . nil)) :config (yas-reload-all) (add-hook 'prog-mode-hook #'yas-minor-mode) (add-hook 'org-mode-hook #'yas-minor-mode)) The problem is I have to invoke `(yas-reload-all)` every time I'm in org-mode although its presence in the config portion. What is wrong with this configuration?
eis3nheim · 2022-06-07 19:40
The issue is because of the`:bind` section. This makes yasnippet to load lazily on the first invocation of `yas-expand`. (use-package yasnippet :bind (:map yas-minor-mode-map ("C-'" . yas-expand) ([(tab)] . nil) ("TAB" . nil)) :hook ((org-mode . yas-minor-mode) (prog-mode . yas-minor-mode)) :config (yas-reload-all)) Thanks to SqrtMinusOne.