+ Group hooks with add-hook! + Sharpquote elfeed call + Extract elfeed buffer detector into function and ensure idempotency of doom-real-buffer-functions
26 lines
1 KiB
EmacsLisp
26 lines
1 KiB
EmacsLisp
;;; tools/pdf/config.el -*- lexical-binding: t; -*-
|
|
|
|
(def-package! pdf-tools
|
|
:mode ("\\.pdf\\'" . pdf-view-mode)
|
|
:config
|
|
(unless noninteractive
|
|
(pdf-tools-install))
|
|
|
|
(define-key! pdf-view-mode-map
|
|
"q" #'kill-this-buffer
|
|
(kbd doom-leader-key) nil)
|
|
|
|
(setq-default pdf-view-display-size 'fit-page)
|
|
;; Turn off cua so copy works
|
|
(add-hook! 'pdf-view-mode-hook (cua-mode 0))
|
|
;; Custom modeline that removes useless info and adds page numbers
|
|
(when (featurep! :ui doom-modeline)
|
|
(load! "+modeline")
|
|
(add-hook! #'pdf-tools-enabled-hook (doom-set-modeline 'pdf-tools-modeline)))
|
|
;; Handle PDF-tools related popups better
|
|
(set! :popup "^\\*Outline*" '((side . right) (size . 40)) '((select)))
|
|
;; TODO: Add additional important windows that should be handled differently
|
|
;; TODO: These two next rules don't work (they should), investigate
|
|
;; (set! :popup "\\*Contents\\*" '((side . right) (size . 40)) nil)
|
|
;; (set! :popup "* annots\\*$" '((side . left) (size . 40)) '((select)))
|
|
)
|