From e52ba1a14346e01efb56b71cbbc1c4dfe5186253 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 25 Aug 2023 08:38:03 -0700 Subject: [PATCH] Fixed some yassnippet issues that have been plaguing me. --- ha-config.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ha-config.org b/ha-config.org index 35ee10a..6c56aff 100644 --- a/ha-config.org +++ b/ha-config.org @@ -1624,7 +1624,12 @@ Since auto insertion requires entering data for particular fields, and for that #+begin_src emacs-lisp (defun ha-autoinsert-yas-expand() "Replace text in yasnippet template." - (yas-expand-snippet (buffer-string) (point-min) (point-max))) + (let ((orig-mode major-mode) + (auto-insert-query nil) + (yas-indent-line nil)) + (yas/minor-mode 1) + (evil-insert-state) + (yas-expand-snippet (buffer-string) (point-min) (point-max)))) #+end_src And since I'll be associating snippets with new files all over my configuration, let's make a helper function: