emacs: open read-only buffers in view-mode
[~bandali/configs] / .emacs.d / init.el
index 6eeb23f..9ccc3bb 100644 (file)
@@ -445,6 +445,10 @@ For disabling the behaviour for certain buffers and/or modes."
 ;; allow scrolling in Isearch
 (setq isearch-allow-scroll t)
 
+;; open read-only file buffers in view-mode
+;; (enables niceties like `q' for quit)
+(setq view-read-only t)
+
 (use-feature vc
   :bind ("C-x v C-=" . vc-ediff))
 
@@ -486,6 +490,15 @@ For disabling the behaviour for certain buffers and/or modes."
 (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"
@@ -1532,10 +1545,6 @@ For disabling the behaviour for certain buffers and/or modes."
   :commands (alert)
   :init (setq alert-default-style 'notifications))
 
-(use-package ivy-xref
-  :init
-  (setq xref-show-xrefs-function #'ivy-xref-show-xrefs))
-
 ;; (use-package fill-column-indicator)
 
 (use-package emojify