From 0ee7fa9c382ae30295f0b8d88457f7856c7ff800 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 16 Oct 2024 22:04:33 +0200 Subject: emacs: Overhaul configuration completely --- .config/emacs/site-lisp/line-selection-mode.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .config/emacs/site-lisp/line-selection-mode.el (limited to '.config/emacs/site-lisp/line-selection-mode.el') 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) -- cgit v1.2.3