There are various discussions around the conflict between Org Mode and yasnippet and how to fix it.

This is how I got them to play nicely together.


You can read about my other Emacs configurations .


(use-package yasnippet
  :init
  (defun yas/org-very-safe-expand ()
    (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
  :hook
  ((emacs-lisp-mode . yas-minor-mode)
   (python-mode . yas-minor-mode)
   (org-mode . yas-minor-mode)
   (org-mode . (lambda ()
                 (make-variable-buffer-local 'yas/trigger-key)
                 (setq yas/trigger-key [tab])
                 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
                 (define-key yas/keymap [tab] 'yas/next-field))))
  :config
  (setq-default yas-snippet-dirs `(,(expand-file-name "snippets/" user-emacs-directory)))
  (yas-reload-all))

GNU Emacs 28.1 Org mode version 9.5.3 YASnippet 0.14.0