summaryrefslogtreecommitdiff
path: root/.config/emacs/site-lisp/line-selection-mode.el
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-16 22:04:33 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-10-16 22:04:33 +0200
commit0ee7fa9c382ae30295f0b8d88457f7856c7ff800 (patch)
tree6b5a0cf01fa0bfa4d01b0134b268f5d993055c0b /.config/emacs/site-lisp/line-selection-mode.el
parentd452ae1347b3711bc0a7ac80cfa2c37d9d63836e (diff)
emacs: Overhaul configuration completely
Diffstat (limited to '.config/emacs/site-lisp/line-selection-mode.el')
-rw-r--r--.config/emacs/site-lisp/line-selection-mode.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/emacs/site-lisp/line-selection-mode.el b/.config/emacs/site-lisp/line-selection-mode.el
new file mode 100644
index 0000000..83da013
--- /dev/null
+++ b/.config/emacs/site-lisp/line-selection-mode.el
@@ -0,0 +1,18 @@
+;;; line-selection-mode.el --- Minor mode for selection by lines -*- lexical-binding: t; -*-
+
+(defvar-local line-selection-mode--cursor-type nil)
+
+;;;###autoload
+(define-minor-mode line-selection-mode
+ "Enable `hl-line-mode' and hide the current cursor."
+ :global nil
+ :init-value nil
+ (if line-selection-mode
+ (progn
+ (hl-line-mode)
+ (setq line-selection-mode--cursor-type cursor-type)
+ (setq-local cursor-type nil))
+ (hl-line-mode -1)
+ (setq-local cursor-type line-selection-mode--cursor-type)))
+
+(provide 'line-selection-mode)