Uncluttered custom modeline to show page numbers

Add rules to handle windows that should not be considered as popups.
This commit is contained in:
UndeadKernel 2018-04-12 16:03:48 +02:00
parent 717f6e3cfe
commit 12fd06d4e6
2 changed files with 24 additions and 2 deletions

View file

@ -0,0 +1,10 @@
;;; tools/pdf/+modeline.el -*- lexical-binding: t; -*-
(def-modeline-segment! +pdf-tools-pages
"Current and total page indicator for PDF documents."
(format " P %d/%d" (pdf-view-current-page) (pdf-cache-number-of-pages)))
(def-modeline! pdf-tools-modeline
(bar matches " " buffer-info +pdf-tools-pages)
(major-mode vcs))

View file

@ -9,6 +9,18 @@
(map! :map pdf-view-mode-map "q" #'kill-this-buffer)
;; Fit pages to screen by default
(setq-default pdf-view-display-size 'fit-page)
;; turn off cua so copy works
(add-hook! 'pdf-view-mode-hook (cua-mode 0)))
;; 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 (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)))
)