From 7329b044f3861f515bdaa2399c9253658dc859d9 Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 12 Sep 2024 12:35:11 +0200 Subject: [PATCH] ADD save-symbol-at-point function This was originally supplied by smartparens but I don't need the whole package for this function. Other functionality which I used from smartparens is available with electric-pair-mode . --- config_new.org | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config_new.org b/config_new.org index 4866110..688035d 100644 --- a/config_new.org +++ b/config_new.org @@ -379,3 +379,17 @@ https://github.com/remyferre/comment-dwim-2 (define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map) (projectile-mode +1) ) + +* Custom + +** Save symbol at point + +#+BEGIN_SRC emacs-lisp +(defun myrmi/save-symbol-at-point () + "Make symbol at point the latest kill in the kill ring." + (interactive) + (let ((symbol (thing-at-point 'symbol))) + (when symbol (kill-new symbol)))) + +(global-set-key (kbd "C-M-w") 'myrmi/save-symbol-at-point) +#+END_SRC