summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authornoa2024-09-17 10:12:50 +0800
committernoa2024-09-17 10:12:50 +0800
commit7ab0fb4af78c2f2da0fc6de8c6b9b25c68ab3aa8 (patch)
treeed294d948e40d636259a8a97fb9c85108444f530 /emacs
parent95a6714db23fe78786521935f942af311caf3af3 (diff)
Update shift click to select mouse bindings
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/emacs/init.el b/emacs/init.el
index fcbe172..80dca77 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -239,12 +239,9 @@
 	;; deleting should be an explicit action
 	delete-selection-mode nil)
 
-;; Mouse selection
-
-;; Shift click to select region with the mouse.  This annoyingly rings the bell for an error.  It also interferes with my input method switcher, which doesn't notice the mouse click and thinks i've pressed shift with no other keys.
-
-(global-unset-key (kbd "S-<down-mouse-1>"))
-(global-set-key (kbd "S-<down-mouse-1>") 'mouse-save-then-kill)
+;; Shift click to select region with the mouse.  I had a poor workaround for this before, but found an article (https://christiantietze.de/posts/2022/07/shift-click-in-emacs-to-select/) which shows me how to do it more pleasantly.  In the same article i also discovered the existence of mouse-drag-secondary, which i think i will not make use of but is cool nonetheless.  It also showed me mouse-drag-region-rectangle, which doesn't work great with a proportional font, but could still be useful.
+(global-set-key (kbd "S-<down-mouse-1>") #'mouse-set-mark)
+(global-set-key (kbd "C-S-<down-mouse-1>") #'mouse-drag-region-rectangle)
 
 ;;; Writing prose
 ;; The majority of the work i do in emacs is writing documents, so it's nice to know that the words coming out of my fingers are the ones i expect them to be.