emacs: add a few global mouse-based bindings for convenience
authorAmin Bandali <bandali@gnu.org>
Wed, 29 May 2019 01:38:08 +0000 (21:38 -0400)
committerAmin Bandali <bandali@gnu.org>
Wed, 29 May 2019 01:38:08 +0000 (21:38 -0400)
.emacs.d/init.el

index 25a8ada..b67efd0 100644 (file)
@@ -486,6 +486,15 @@ For disabling the behaviour for certain buffers and/or modes."
 (when (display-graphic-p)
   (unbind-key "C-z" global-map))
 
 (when (display-graphic-p)
   (unbind-key "C-z" global-map))
 
+(bind-keys
+ ;; for back and forward mouse keys
+ ("<mouse-8>"      . previous-buffer)
+ ("<drag-mouse-8>" . previous-buffer)
+ ("<mouse-9>"      . next-buffer)
+ ("<drag-mouse-9>" . next-buffer)
+ ("<drag-mouse-2>" . kill-this-buffer)
+ ("<drag-mouse-3>" . ivy-switch-buffer))
+
 (bind-keys
  :prefix-map a/straight-prefix-map
  :prefix "C-c p s"
 (bind-keys
  :prefix-map a/straight-prefix-map
  :prefix "C-c p s"