summaryrefslogtreecommitdiff
path: root/emacs-config.org
diff options
context:
space:
mode:
Diffstat (limited to 'emacs-config.org')
-rw-r--r--emacs-config.org12
1 files changed, 12 insertions, 0 deletions
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