From a301db6205e8761c89c325d8ed0d83d23c2d0b43 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 21 Oct 2023 07:55:55 +0200 Subject: [PATCH] Remove yasnippets I never use them, why install it then? --- configuration.org | 79 ----------------------------------------------- 1 file changed, 79 deletions(-) diff --git a/configuration.org b/configuration.org index 7a03dad..9e0ad2f 100644 --- a/configuration.org +++ b/configuration.org @@ -984,48 +984,6 @@ EDiff and Org-mode files don’t play nice together… (activate-mark)) #+END_SRC -** Turn the cursor to purple if Yasnippet’s TAB function would fire - -Taken from [[http://pages.sachachua.com/.emacs.d/Sacha.html][Sacha Chua’s config]]. - -#+BEGIN_SRC emacs-lisp -;; TODO: 'cursor-color is sometimes nil, but why? -(setq default-cursor-color (or (frame-parameter nil 'cursor-color) "#ffd85c")) -(setq yasnippet-can-fire-cursor-color "purple") - -;; It will test whether it can expand, if yes, cursor color -> purple. -(defun yasnippet-can-fire-p (&optional field) - "Check if the word before point can be expanded with yasnippet. - -TODO: What is FIELD for?" - (interactive) - (setq yas--condition-cache-timestamp (current-time)) - (let (templates-and-pos) - (unless (and yas-expand-only-for-last-commands - (not (member last-command yas-expand-only-for-last-commands))) - (setq templates-and-pos (if field - (save-restriction - (narrow-to-region (yas--field-start field) - (yas--field-end field)) - (yas--templates-for-key-at-point)) - (yas--templates-for-key-at-point)))) - (and templates-and-pos (first templates-and-pos)))) - -(defun sachachua/change-cursor-color-when-can-expand (&optional field) - "Change cursor color if the text before point can be expanded with yasnippet. - -TODO: What is FIELD for?" - (interactive) - (when (eq last-command 'self-insert-command) - (set-cursor-color (if (sachachua/can-expand) - yasnippet-can-fire-cursor-color - default-cursor-color)))) - -(defun sachachua/can-expand () - "Return t if right after an expandable thing." - (or (abbrev--before-point) (yasnippet-can-fire-p))) -#+END_SRC - ** Org mode stuff *** Filter out tasks from the Org agenda if they have a specific priority @@ -2676,33 +2634,6 @@ Automatically add spaces around operators. (python-mode . electric-operator-mode)) #+END_SRC -** Yasnippets - -#+BEGIN_SRC emacs-lisp -(use-package yasnippet - :demand - :config - (yas-global-mode 1) - :hook - (post-command . sachachua/change-cursor-color-when-can-expand)) -#+END_SRC - -*** Extra snippets for Vala - -#+BEGIN_SRC emacs-lisp -(use-package vala-snippets - :after - yasnippet) -#+END_SRC - -*** Miscellanous extra snippets - -#+BEGIN_SRC emacs-lisp -(use-package yasnippet-snippets - :after - yasnippet) -#+END_SRC - ** Colourful delimiters #+BEGIN_SRC emacs-lisp @@ -3459,16 +3390,6 @@ The new completing system! (use-package consult-projectile) #+end_src -** Yasnippets with Consult - -#+begin_src emacs-lisp -(use-package consult-yasnippet - :after - yasnippet - :bind - (("C-c y" . consult-yasnippet))) -#+end_src - * Mode specific ~use-package~ calls ** JavaScript