From f51b29743f0e7fc4026e106f0bc250e66bdadc88 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Thu, 10 Jul 2025 10:09:18 +0100 Subject: Add advice to copy line or region from cursor point --- emacs-config.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/emacs-config.org b/emacs-config.org index 26fcab9..86793b8 100644 --- a/emacs-config.org +++ b/emacs-config.org @@ -44,6 +44,18 @@ Automatically move cursor point on window split. :after (lambda (&rest r) (other-window 1))) #+end_src +Add advice to copy line at cursor point or region. +#+begin_src elisp + (defadvice kill-ring-save (before dwim-copy activate compile) + "Copy the current line at cursor point or region." + (interactive + (if mark-active + (list (region-beginning) (region-end)) + (message "Line copied") + (list (line-beginning-position) + (line-beginning-position 2))))) +#+end_src + ** Editor Tab behaviour settings. #+begin_src elisp -- cgit