From 466de2136570aa646b6c8b8e87191dc9fcca5ef0 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sun, 26 Mar 2023 16:24:36 +0200 Subject: [PATCH] Fix yasnippet and or conflict --- modules/development/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/development/default.nix b/modules/development/default.nix index 2e509956..89296223 100644 --- a/modules/development/default.nix +++ b/modules/development/default.nix @@ -58,6 +58,17 @@ ;; Snippets (use-package yasnippet + :init + ;; See https://orgmode.org/org.html#index-yasnippet_002eel + (defun yas/org-very-safe-expand () (let ((yas/fallback-behavior 'return-nil)) (yas/expand))) + (defun chvp/yas-org-fix () ( + (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) + )) + :hook + (org-mode . chvp/yas-org-fix) ;; This is not very nice, but let's just assume that development machines have my nixos-config checked out :custom (yas-snippet-dirs '("/home/charlotte/repos/nixos-config/modules/development/snippets/")) :diminish (yas-minor-mode)