+ :popup -> set-popup-rule! + :popups -> set-popup-rules! + :company-backend -> set-company-backend! + :evil-state -> set-evil-initial-state! I am slowly phasing out the setting system (def-setting! and set!), starting with these. What are autodefs? These are functions that are always defined, whether or not their respective modules are enabled. However, when their modules are disabled, they are replaced with macros that no-op and don't waste time evaluating their arguments. The old set! function will still work, for a while.
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-rule! "^\\*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-rule! "\\*Contents\\*" '((side . right) (size . 40)) nil)
|
|
;; (set-popup-rule! "* annots\\*$" '((side . left) (size . 40)) '((select)))
|
|
)
|