diff --git a/config.org b/config.org index cf7986b..f3720a7 100644 --- a/config.org +++ b/config.org @@ -1733,6 +1733,55 @@ We then configure the dictionary we're using in [[*Ispell][Ispell]]. #+begin_src emacs-lisp (set-company-backend! 'ess-r-mode '(company-R-args company-R-objects company-dabbrev-code :separate)) #+end_src +** Doom modeline +Very nice and pretty, however I think the PDF modeline could do with tweaking. +I raised [[https://github.com/seagle0128/doom-modeline/pull/425][an issue]] on this, however the response was basically "put your +preferences in your personal config, the current default is sensible" --- so +here we are. + +First up I'm going to want a segment for just the buffer file name, and a PDF +icon. Then we'll redefine two functions used to generate the modeline. + +#+begin_src emacs-lisp +(after! doom-modeline + (doom-modeline-def-segment buffer-name + "Display the current buffer's name, without any other information." + (concat + (doom-modeline-spc) + (doom-modeline--buffer-name))) + + (doom-modeline-def-segment pdf-icon + "PDF icon from all-the-icons." + (concat + (doom-modeline-spc) + (doom-modeline-icon 'octicon "file-pdf" nil nil + :face (if (doom-modeline--active) + 'all-the-icons-red + 'mode-line-inactive) + :v-adjust 0.02))) + + (defun doom-modeline-update-pdf-pages () + "Update PDF pages." + (setq doom-modeline--pdf-pages + (let ((current-page-str (number-to-string (eval `(pdf-view-current-page)))) + (total-page-str (number-to-string (pdf-cache-number-of-pages)))) + (concat + (propertize + (concat (make-string (- (length total-page-str) (length current-page-str)) ? ) + " P" current-page-str) + 'face 'mode-line) + (propertize (concat "/" total-page-str) 'face 'doom-modeline-buffer-minor-mode))))) + + (doom-modeline-def-segment pdf-pages + "Display PDF pages." + (if (doom-modeline--active) doom-modeline--pdf-pages + (propertize doom-modeline--pdf-pages 'face 'mode-line-inactive))) + + (doom-modeline-def-modeline 'pdf + '(bar window-number pdf-pages pdf-icon buffer-name) + '(misc-info matches major-mode process vcs))) +#+end_src + ** Elcord #+begin_src emacs-lisp (setq elcord-use-major-mode-as-main-icon t)