updates to make mini-echo instead of doom-modeline work

This commit is contained in:
Chris Cochrun 2023-11-08 06:22:20 -06:00
parent 8701afbf55
commit 71d3eeb60a
3 changed files with 208 additions and 15 deletions

View file

@ -200,6 +200,7 @@ Finally this is not part of the UI but let's do this early and start the server
I will also add my personal scripts to emacs' PATH I will also add my personal scripts to emacs' PATH
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'exec-path "/home/chris/bin") (add-to-list 'exec-path "/home/chris/bin")
(add-to-list 'exec-path "/home/chris/.cargo/bin")
#+end_src #+end_src
Let's also set org-mode as the scratch buffer mode Let's also set org-mode as the scratch buffer mode
@ -281,7 +282,7 @@ Probably the prettiest and best modeline I've found.
(use-package doom-modeline (use-package doom-modeline
:ensure t :ensure t
:init :init
(doom-modeline-mode 1) (doom-modeline-mode 0)
(setq doom-modeline-height 25 (setq doom-modeline-height 25
doom-modeline-bar-width 3 doom-modeline-bar-width 3
all-the-icons-scale-factor 0.9 all-the-icons-scale-factor 0.9
@ -305,6 +306,32 @@ Probably the prettiest and best modeline I've found.
nano-modeline-prefix 'icon)) nano-modeline-prefix 'icon))
#+end_src #+end_src
#+begin_src emacs-lisp
(use-package mini-echo
:init
(mini-echo-mode 1)
(setq mini-echo-default-segments '(:long
("evil" "major-mode" "buffer-name" "vcs" "buffer-position" "buffer-size"
"flymake" "process" "selection-info" "narrow" "macro" "profiler")
:short
("buffer-name-short" "buffer-position" "process" "profiler"
"selection-info" "narrow" "macro"))
mini-echo-rules '((org-mode :long
(("evil" . 1)
("major-mode" . 2)
("buffer-name" . 3)
("word-count" . 4))))
mini-echo-right-padding 0
mini-echo-buffer-status-style 'both)
:config
(defun chris/toggle-mode-lines ()
"Switch between doom and mini-echo"
(interactive)
(if mini-echo-mode
(eval (mini-echo-mode 0) (doom-modeline-mode 1))
(eval (doom-modeline-mode 0) (mini-echo-mode 1)))))
#+end_src
Again, doom is pretty and I have fallen in love with the snazzy theme and use it about anywhere I can. Again, doom is pretty and I have fallen in love with the snazzy theme and use it about anywhere I can.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package doom-themes (use-package doom-themes
@ -931,6 +958,43 @@ Part of this config includes some special capture templates for my work as a you
("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(setq org-publish-project-alist
`(("home"
:base-directory "~/org/"
:base-extension "org"
:exclude ".*"
:include "index.org"
:recursive nil
:html-doctype "html5"
:html-html5-fancy t
:html-self-link-headlines t
:html-head "<link rel=\"stylesheet\" href=\"content/pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/"
:publishing-function org-html-publish-to-html)
("posts"
:base-directory "~/org/"
:base-extension "org"
:exclude "bibles\\|.st.*\\|.templates"
:recursive t
:html-doctype "html5"
:html-html5-fancy t
:html-self-link-headlines t
:htmlized-source t
:html-head "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/content/"
:publishing-function org-html-publish-to-html)
("static"
:base-directory "~/org/"
:base-extension "css\\|txt\\|jpg\\|gif\\|png"
:exclude "bibles\\|.st.*\\|.templates"
:recursive t
:html-doctype "html5"
:html-html5-fancy t
:html-head "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/content/"
:publishing-function org-publish-attachment)
("cochrun.xyz" :components ("home" "posts" "static"))))
:general :general
(chris/leader-keys (chris/leader-keys
:states 'normal :states 'normal
@ -1777,6 +1841,9 @@ Here we can add those functions to the proper keys in both normal and insert mod
: +org-enable-auto-update-cookies-h : +org-enable-auto-update-cookies-h
*** Org Reveal *** Org Reveal
:PROPERTIES:
:ID: 20231024T143730.876619
:END:
Org reveal allows me to create beautiful and powerful slideshows using the incredible reveal.js system. Whilst I hate the web making so much into terrible things, I do really like reveal.js. It's honestly a much better picture of what javascript can do than apps like Facebook. Org reveal allows me to create beautiful and powerful slideshows using the incredible reveal.js system. Whilst I hate the web making so much into terrible things, I do really like reveal.js. It's honestly a much better picture of what javascript can do than apps like Facebook.
So, how do we use this? Well, let's try like this. So, how do we use this? Well, let's try like this.
@ -1789,7 +1856,34 @@ So, how do we use this? Well, let's try like this.
org-re-reveal-transition "slide" org-re-reveal-transition "slide"
org-re-reveal-mobile-app t org-re-reveal-mobile-app t
org-re-reveal-width "90%") org-re-reveal-width "90%")
) (add-to-list 'org-re-reveal-plugin-config '(audio-slideshow "RevealAudioSlideshow" "plugin/audio-slideshow/plugin.js"))
(defun chris/org-re-reveal-export-to-html
(&optional async subtreep visible-only body-only ext-plist backend)
"Export current buffer to a reveal.js HTML file with a different name
so that it can exists within a static site showing the file as a document
as well as a presentation.
Optional ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST are passed
to `org-export-to-file'.
Optional BACKEND must be `re-reveal' or a backend derived from it."
(interactive)
(let* ((backend (or backend 're-reveal))
(extension (concat "-presentation" "." org-html-extension))
(client-ext (concat org-re-reveal-multiplex-client-ext extension))
(file (org-export-output-file-name extension subtreep))
(clientfile (org-export-output-file-name client-ext subtreep))
(org-html-container-element "div"))
(setq org-re-reveal-client-multiplex nil)
(org-export-to-file backend file
async subtreep visible-only body-only ext-plist)
;; Export the client HTML file if org-re-reveal-client-multiplex is set true
;; by previous call to org-export-to-file
(if org-re-reveal-client-multiplex
(org-export-to-file backend clientfile
async subtreep visible-only body-only ext-plist))
file)))
#+end_src #+end_src
*** Ox-Spectacle *** Ox-Spectacle
@ -3480,7 +3574,7 @@ Ledger mode
:END: :END:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package mu4e (use-package mu4e
:load-path "~/.guix-home/profile/share/emacs/site-lisp/mu4e/" ;; :load-path "~/.guix-home/profile/share/emacs/site-lisp/mu4e/"
:init :init
(setq mu4e-maildir "~/mail" (setq mu4e-maildir "~/mail"
@ -3833,7 +3927,7 @@ Let's add our own eshell prompt. and set the password cache to a significantly h
(lambda nil (lambda nil
(let ((path (abbreviate-file-name (eshell/pwd)))) (let ((path (abbreviate-file-name (eshell/pwd))))
(concat (concat
(if (or (string= system-name "archdesktop") (string= system-name "syl")) (if (or (string= system-name "kaladin") (string= system-name "syl"))
nil nil
(format (format
(propertize "\n(%s@%s)" 'face '(:foreground "#606580")) (propertize "\n(%s@%s)" 'face '(:foreground "#606580"))
@ -3845,7 +3939,7 @@ Let's add our own eshell prompt. and set the password cache to a significantly h
(format (format
(propertize "\n[ %s | %s@%s ]" 'face font-lock-comment-face) (propertize "\n[ %s | %s@%s ]" 'face font-lock-comment-face)
(propertize root 'face `(:inherit org-warning)) (propertize root 'face `(:inherit org-warning))
(propertize after-root 'face `(:inherit org-level-1 :height 1.0)) (propertize after-root 'face `(:inherit org-level-1 :height 0.7))
(propertize (or (magit-get-current-branch) (magit-get-current-tag)) 'face `(:inherit org-macro)))) (propertize (or (magit-get-current-branch) (magit-get-current-tag)) 'face `(:inherit org-macro))))
(format (format
(propertize "\n[%s]" 'face font-lock-comment-face) (propertize "\n[%s]" 'face font-lock-comment-face)
@ -3872,7 +3966,7 @@ Let's add our own eshell prompt. and set the password cache to a significantly h
(setq eshell-banner-message "") (setq eshell-banner-message "")
(setq eshell-path-env "/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin") (setq eshell-path-env "/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin:/home/chris/.cargo/bin")
;; this makes it so flutter works properly ;; this makes it so flutter works properly
(setenv "ANDROID_SDK_ROOT" "/opt/android-sdk") (setenv "ANDROID_SDK_ROOT" "/opt/android-sdk")
@ -4014,7 +4108,12 @@ Let's use pdf-tools for a lot better interaction with pdfs.
(custom-set-variables '(pdf-misc-print-program-executable "lpr") (custom-set-variables '(pdf-misc-print-program-executable "lpr")
'(pdf-misc-print-program-args (quote ("-o media=Letter" "-o fitplot" "-o sides=two-sided-long-edge")))) '(pdf-misc-print-program-args (quote ("-o media=Letter" "-o fitplot" "-o sides=two-sided-long-edge"))))
(add-hook 'pdf-view-mode 'pdf-view-fit-page-to-window)) (add-hook 'pdf-view-mode 'pdf-view-fit-page-to-window)
:general
(general-def
:states 'normal
:keymaps 'pdf-view-mode-map
"C-p" 'chris/print-multi-pdf))
#+end_src #+end_src
** EPUB ** EPUB

108
init.el
View file

@ -87,6 +87,7 @@
;; (add-to-list 'savehist-additional-variables kill-ring) ;; (add-to-list 'savehist-additional-variables kill-ring)
(add-to-list 'exec-path "/home/chris/bin") (add-to-list 'exec-path "/home/chris/bin")
(add-to-list 'exec-path "/home/chris/.cargo/bin")
(setq initial-major-mode 'org-mode) (setq initial-major-mode 'org-mode)
(setq initial-scratch-message "#+TITLE: SCRATCH\n#+DESCRIPTION: This buffer is for temporary things") (setq initial-scratch-message "#+TITLE: SCRATCH\n#+DESCRIPTION: This buffer is for temporary things")
@ -114,7 +115,7 @@
(use-package doom-modeline (use-package doom-modeline
:ensure t :ensure t
:init :init
(doom-modeline-mode 1) (doom-modeline-mode 0)
(setq doom-modeline-height 25 (setq doom-modeline-height 25
doom-modeline-bar-width 3 doom-modeline-bar-width 3
all-the-icons-scale-factor 0.9 all-the-icons-scale-factor 0.9
@ -129,6 +130,30 @@
(with-selected-frame frame (with-selected-frame frame
(setq doom-modeline-icon t)))))) (setq doom-modeline-icon t))))))
(use-package mini-echo
:init
(mini-echo-mode 1)
(setq mini-echo-default-segments '(:long
("evil" "major-mode" "buffer-name" "vcs" "buffer-position" "buffer-size"
"flymake" "process" "selection-info" "narrow" "macro" "profiler")
:short
("buffer-name-short" "buffer-position" "process" "profiler"
"selection-info" "narrow" "macro"))
mini-echo-rules '((org-mode :long
(("evil" . 1)
("major-mode" . 2)
("buffer-name" . 3)
("word-count" . 4))))
mini-echo-right-padding 0
mini-echo-buffer-status-style 'both)
:config
(defun chris/toggle-mode-lines ()
"Switch between doom and mini-echo"
(interactive)
(if mini-echo-mode
(eval (mini-echo-mode 0) (doom-modeline-mode 1))
(eval (doom-modeline-mode 0) (mini-echo-mode 1)))))
(use-package doom-themes (use-package doom-themes
:ensure t :ensure t
:init (load-theme 'doom-snazzy t)) :init (load-theme 'doom-snazzy t))
@ -642,6 +667,43 @@ much faster. The hope is to also make this a faster version of imenu."
("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(setq org-publish-project-alist
`(("home"
:base-directory "~/org/"
:base-extension "org"
:exclude ".*"
:include "index.org"
:recursive nil
:html-doctype "html5"
:html-html5-fancy t
:html-self-link-headlines t
:html-head "<link rel=\"stylesheet\" href=\"content/pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/"
:publishing-function org-html-publish-to-html)
("posts"
:base-directory "~/org/"
:base-extension "org"
:exclude "bibles\\|.st.*\\|.templates"
:recursive t
:html-doctype "html5"
:html-html5-fancy t
:html-self-link-headlines t
:htmlized-source t
:html-head "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/content/"
:publishing-function org-html-publish-to-html)
("static"
:base-directory "~/org/"
:base-extension "css\\|txt\\|jpg\\|gif\\|png"
:exclude "bibles\\|.st.*\\|.templates"
:recursive t
:html-doctype "html5"
:html-html5-fancy t
:html-head "<link rel=\"stylesheet\" href=\"pico/css/pico.css\" type=\"text/css\"/>"
:publishing-directory "~/cochrun.xyz/content/"
:publishing-function org-publish-attachment)
("cochrun.xyz" :components ("home" "posts" "static"))))
:general :general
(chris/leader-keys (chris/leader-keys
:states 'normal :states 'normal
@ -1428,7 +1490,34 @@ All my (performant) foldings needs are met between this and `org-show-subtree'
org-re-reveal-transition "slide" org-re-reveal-transition "slide"
org-re-reveal-mobile-app t org-re-reveal-mobile-app t
org-re-reveal-width "90%") org-re-reveal-width "90%")
) (add-to-list 'org-re-reveal-plugin-config '(audio-slideshow "RevealAudioSlideshow" "plugin/audio-slideshow/plugin.js"))
(defun chris/org-re-reveal-export-to-html
(&optional async subtreep visible-only body-only ext-plist backend)
"Export current buffer to a reveal.js HTML file with a different name
so that it can exists within a static site showing the file as a document
as well as a presentation.
Optional ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST are passed
to `org-export-to-file'.
Optional BACKEND must be `re-reveal' or a backend derived from it."
(interactive)
(let* ((backend (or backend 're-reveal))
(extension (concat "-presentation" "." org-html-extension))
(client-ext (concat org-re-reveal-multiplex-client-ext extension))
(file (org-export-output-file-name extension subtreep))
(clientfile (org-export-output-file-name client-ext subtreep))
(org-html-container-element "div"))
(setq org-re-reveal-client-multiplex nil)
(org-export-to-file backend file
async subtreep visible-only body-only ext-plist)
;; Export the client HTML file if org-re-reveal-client-multiplex is set true
;; by previous call to org-export-to-file
(if org-re-reveal-client-multiplex
(org-export-to-file backend clientfile
async subtreep visible-only body-only ext-plist))
file)))
(use-package jinx (use-package jinx
;; :hook (emacs-startup . global-jinx-mode) ;; :hook (emacs-startup . global-jinx-mode)
@ -2477,7 +2566,7 @@ targets."
(use-package ledger-mode) (use-package ledger-mode)
(use-package mu4e (use-package mu4e
:load-path "~/.guix-home/profile/share/emacs/site-lisp/mu4e/" ;; :load-path "~/.guix-home/profile/share/emacs/site-lisp/mu4e/"
:init :init
(setq mu4e-maildir "~/mail" (setq mu4e-maildir "~/mail"
@ -2772,7 +2861,7 @@ targets."
(lambda nil (lambda nil
(let ((path (abbreviate-file-name (eshell/pwd)))) (let ((path (abbreviate-file-name (eshell/pwd))))
(concat (concat
(if (or (string= system-name "archdesktop") (string= system-name "syl")) (if (or (string= system-name "kaladin") (string= system-name "syl"))
nil nil
(format (format
(propertize "\n(%s@%s)" 'face '(:foreground "#606580")) (propertize "\n(%s@%s)" 'face '(:foreground "#606580"))
@ -2784,7 +2873,7 @@ targets."
(format (format
(propertize "\n[ %s | %s@%s ]" 'face font-lock-comment-face) (propertize "\n[ %s | %s@%s ]" 'face font-lock-comment-face)
(propertize root 'face `(:inherit org-warning)) (propertize root 'face `(:inherit org-warning))
(propertize after-root 'face `(:inherit org-level-1 :height 1.0)) (propertize after-root 'face `(:inherit org-level-1 :height 0.7))
(propertize (or (magit-get-current-branch) (magit-get-current-tag)) 'face `(:inherit org-macro)))) (propertize (or (magit-get-current-branch) (magit-get-current-tag)) 'face `(:inherit org-macro))))
(format (format
(propertize "\n[%s]" 'face font-lock-comment-face) (propertize "\n[%s]" 'face font-lock-comment-face)
@ -2811,7 +2900,7 @@ targets."
(setq eshell-banner-message "") (setq eshell-banner-message "")
(setq eshell-path-env "/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin") (setq eshell-path-env "/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin:/home/chris/.cargo/bin")
;; this makes it so flutter works properly ;; this makes it so flutter works properly
(setenv "ANDROID_SDK_ROOT" "/opt/android-sdk") (setenv "ANDROID_SDK_ROOT" "/opt/android-sdk")
@ -2928,7 +3017,12 @@ targets."
(custom-set-variables '(pdf-misc-print-program-executable "lpr") (custom-set-variables '(pdf-misc-print-program-executable "lpr")
'(pdf-misc-print-program-args (quote ("-o media=Letter" "-o fitplot" "-o sides=two-sided-long-edge")))) '(pdf-misc-print-program-args (quote ("-o media=Letter" "-o fitplot" "-o sides=two-sided-long-edge"))))
(add-hook 'pdf-view-mode 'pdf-view-fit-page-to-window)) (add-hook 'pdf-view-mode 'pdf-view-fit-page-to-window)
:general
(general-def
:states 'normal
:keymaps 'pdf-view-mode-map
"C-p" 'chris/print-multi-pdf))
(use-package nov (use-package nov
:mode ("\\.epub\\'" . nov-mode) :mode ("\\.epub\\'" . nov-mode)

View file

@ -1,4 +1,4 @@
;;; Automatically generated by recentf on Tue Aug 15 12:25:24 2023. ;;; Automatically generated by recentf on Wed Oct 25 05:57:27 2023.
(setq recentf-list (setq recentf-list
'( '(