feat(modeline): add pdf pages to +light modeline
This commit is contained in:
parent
9fa122cc31
commit
07f2d17a11
1 changed files with 23 additions and 3 deletions
|
@ -499,6 +499,19 @@ lines are selected, or the NxM dimensions of a block selection.")
|
||||||
(concat (upcase (symbol-name (plist-get sys :name)))
|
(concat (upcase (symbol-name (plist-get sys :name)))
|
||||||
" "))))))
|
" "))))))
|
||||||
|
|
||||||
|
(def-modeline-var! +modeline-pdf-page nil
|
||||||
|
"Display page number of pdf"
|
||||||
|
:local t)
|
||||||
|
|
||||||
|
(defun +modeline-update-pdf-pages ()
|
||||||
|
"Update PDF pages."
|
||||||
|
(setq +modeline-pdf-page
|
||||||
|
(format " P%d/%d "
|
||||||
|
(eval `(pdf-view-current-page))
|
||||||
|
(pdf-cache-number-of-pages))))
|
||||||
|
|
||||||
|
(add-hook 'pdf-view-change-page-hook #'+modeline-update-pdf-pages)
|
||||||
|
|
||||||
;; Clearer mnemonic labels for EOL styles
|
;; Clearer mnemonic labels for EOL styles
|
||||||
(setq eol-mnemonic-dos "CRLF"
|
(setq eol-mnemonic-dos "CRLF"
|
||||||
eol-mnemonic-mac "CR"
|
eol-mnemonic-mac "CR"
|
||||||
|
@ -541,15 +554,22 @@ lines are selected, or the NxM dimensions of a block selection.")
|
||||||
" " +modeline-buffer-identification)
|
" " +modeline-buffer-identification)
|
||||||
'("" +modeline-modes))
|
'("" +modeline-modes))
|
||||||
|
|
||||||
;; (def-modeline! pdf
|
(def-modeline! 'pdf
|
||||||
;; '("" +modeline-matches))
|
'(""
|
||||||
|
+modeline-matches
|
||||||
|
" "
|
||||||
|
+modeline-buffer-identification
|
||||||
|
+modeline-pdf-page)
|
||||||
|
`(""
|
||||||
|
+modeline-modes
|
||||||
|
" "))
|
||||||
;; TODO (def-modeline! helm ...)
|
;; TODO (def-modeline! helm ...)
|
||||||
|
|
||||||
|
|
||||||
;; Other modes
|
;; Other modes
|
||||||
(set-modeline! :main 'default)
|
(set-modeline! :main 'default)
|
||||||
(set-modeline-hook! '+doom-dashboard-mode-hook 'project)
|
(set-modeline-hook! '+doom-dashboard-mode-hook 'project)
|
||||||
;; (set-modeline-hook! 'pdf-tools-enabled-hook 'pdf)
|
(set-modeline-hook! 'pdf-tools-enabled-hook 'pdf)
|
||||||
(set-modeline-hook! '(special-mode-hook
|
(set-modeline-hook! '(special-mode-hook
|
||||||
image-mode-hook
|
image-mode-hook
|
||||||
circe-mode-hook)
|
circe-mode-hook)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue