diff options
| author | Magdalena Szweda <hi@roughlynamed.net> | 2026-09-27 12:45:33 +0200 |
|---|---|---|
| committer | Magdalena Szweda <hi@roughlynamed.net> | 2026-09-27 12:45:33 +0200 |
| commit | 30a274f48e1f0746a2aaff34eed09df80a47ec1f (patch) | |
| tree | 306124848ec84a428e9ba10881b191135b2ffa2c /doom | |
| parent | 568475983d15f81dff7b1d70276c77b1b994ce6e (diff) | |
backup
Diffstat (limited to 'doom')
| -rw-r--r-- | doom/.config/doom/config.el | 68 | ||||
| -rw-r--r-- | doom/.config/doom/config.org | 100 | ||||
| -rw-r--r-- | doom/.config/doom/packages.el | 2 | ||||
| -rw-r--r-- | doom/.config/doom/splash.el | 2 |
4 files changed, 158 insertions, 14 deletions
diff --git a/doom/.config/doom/config.el b/doom/.config/doom/config.el index ba72ebf..0e6c0c7 100644 --- a/doom/.config/doom/config.el +++ b/doom/.config/doom/config.el @@ -91,6 +91,13 @@ (add-to-list 'flycheck-checkers 'htmlhint) +(flycheck-add-next-checker + 'javascript-eslint + 'javascript-oxlint) +(flycheck-add-next-checker + 'html-tidy + 'htmlhint) + (setq flycheck-check-syntax-automatically '(save mode-enabled))) @@ -159,7 +166,9 @@ :config (setq jabber-account-list - '(("roughlynamed@yax.im"))) + '( + ;; ("roughlynamed@yax.im") + ("wildebeest@yax.im"))) (jabber-modeline-mode 1) @@ -175,13 +184,37 @@ :desc "New chat" "n" #'jabber-chat-with :desc "Set status" "s" #'jabber-send-presence) +(defun emms--wait-for-mpd-update (callback) + "Poll MPD status until updating_db clears, then call CALLBACK." + (emms-player-mpd-get-status + callback + (lambda (callback info) + (if (assoc "updating_db" info) + (run-with-timer 0.5 nil #'emms--wait-for-mpd-update callback) + (funcall callback))))) + +(defun emms-full-resync () + "Update MPD's db, then pull it into EMMS's cache, then rebuild the browser." + (interactive) + (message "emms: starting mpd db update...") + (emms-player-mpd-update-all) + (emms--wait-for-mpd-update + (lambda () + (emms-cache-set-from-mpd-all) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (derived-mode-p 'emms-browser-mode) + (revert-buffer)))) + (emms-browser) + (message "emms: resync done")))) + (use-package! emms - :commands (emms emms-browser) + :commands (emms emms-browser emms-player-mpd-update-all emms-cache-set-from-mpd-all) :init (map! :leader (:prefix ("e" . "emms") - :desc "Browser" "b" #'emms-browser + :desc "Browser" "b" #'emms-full-resync :desc "Playlist" "m" #'emms-playlist-mode-go :desc "Play/pause" "SPC" #'emms-pause :desc "Next" "n" #'emms-next @@ -406,6 +439,8 @@ org-html-postamble nil)) (setq shr-max-image-size '(800 . 600)) (setq shr-image-animate t) +(add-hook 'eww-after-render-hook #'eww-readable) + (with-eval-after-load 'eww (define-key eww-mode-map (kbd "=") #'text-scale-increase) (define-key eww-mode-map (kbd "-") #'text-scale-decrease) @@ -459,6 +494,33 @@ org-html-postamble nil)) :prefix "o" :desc "Open Eat" "e" #'eat-other-window) ; dont steal the current window +(use-package! nov + :mode ("\\.epub\\'" . nov-mode) + :config + (setq nov-text-width 80 + nov-variable-pitch t) + (add-hook 'nov-mode-hook + (lambda () + (face-remap-add-relative 'variable-pitch + :family "Georgia" :height 1.3))) ; different font for reading + (add-hook 'nov-mode-hook #'writeroom-mode) ; center text & stuff + +(map! :map nov-mode-map + :n "i" #'nov-scroll-up ; scroll roughly a page up + :n "e" #'nov-scroll-down ; scroll roughly a page down + :n "]" #'nov-next-document + :n "[" #'nov-previous-document + :n "t" #'nov-goto-toc)) + +(with-eval-after-load 'tramp + (add-to-list 'tramp-methods + '("doas" + (tramp-login-program "doas") + (tramp-login-args (("-u" "%u") ("-s"))) + (tramp-remote-shell "/bin/sh") + (tramp-remote-shell-args ("-c")) + (tramp-connection-timeout 10)))) + (remove-hook 'doom-first-input-hook #'evil-snipe-mode) (use-package lispyville diff --git a/doom/.config/doom/config.org b/doom/.config/doom/config.org index 5e2ae0b..fc52f43 100644 --- a/doom/.config/doom/config.org +++ b/doom/.config/doom/config.org @@ -191,7 +191,7 @@ I then add the new checker to the flycheck checkers (say that 3 times fast) Here we add additional checkers to flycheck. We add ESLint and oxlint, and then another block for html-tidy and the new htmlhint. The reason this cant be all in one ~flycheck-add-next-checker~ block is because ~flyckech-add-next-checker~ only takes 2 variables. -+begin_src emacs-lisp +#+begin_src emacs-lisp (flycheck-add-next-checker 'javascript-eslint 'javascript-oxlint) @@ -350,7 +350,9 @@ Excuse the bad pun, jabber.el is a way to use XMPP in Emacs. We point jabber at my XMPP account: #+begin_src emacs-lisp (setq jabber-account-list - '(("roughlynamed@yax.im"))) + '( + ;; ("roughlynamed@yax.im") + ("wildebeest@yax.im"))) #+end_src And let jabber use the modeline #+begin_src emacs-lisp @@ -374,27 +376,59 @@ As to not rely on ~M-x~ commands, define a binding as so #+end_src * EMMS +#+begin_quote ~Music to my ears~ +#+end_quote + EMMS, the Emacs MultiMedia System (but mostly its just used for music). +Now, emms has this issue where mpd and the emms cache fall out of sync. This is a documented issue so lets make them catch up by default. + +Let's make a quick helper function. +#+begin_src emacs-lisp +(defun emms--wait-for-mpd-update (callback) + "Poll MPD status until updating_db clears, then call CALLBACK." + (emms-player-mpd-get-status + callback + (lambda (callback info) + (if (assoc "updating_db" info) + (run-with-timer 0.5 nil #'emms--wait-for-mpd-update callback) + (funcall callback))))) +#+end_src + +And wire it into emms +#+BEGIN_SRC emacs-lisp +(defun emms-full-resync () + "Update MPD's db, then pull it into EMMS's cache, then rebuild the browser." + (interactive) + (message "emms: starting mpd db update...") + (emms-player-mpd-update-all) + (emms--wait-for-mpd-update + (lambda () + (emms-cache-set-from-mpd-all) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (derived-mode-p 'emms-browser-mode) + (revert-buffer)))) + (emms-browser) + (message "emms: resync done")))) +#+END_SRC Declare the package block and set up the commands. -** TODO put the following prose in an org-roam file ~:commands~ in elisp is used to eagerly load functions even when a package is lazy loaded. The following makes the commands ~emms~ and ~emms-browser~ available even before emms itself is loaded. #+begin_src emacs-lisp (use-package! emms - :commands (emms emms-browser) + :commands (emms emms-browser emms-player-mpd-update-all emms-cache-set-from-mpd-all) #+end_src Configure the mappings for EMMS -** TODO put the following prose in an org-roam file ~:init~ in elisp runs the following code =before= a package is loaded. In this case, it makes the emms mappings available right when emacs starts up. #+begin_src emacs-lisp :init (map! :leader (:prefix ("e" . "emms") - :desc "Browser" "b" #'emms-browser + :desc "Browser" "b" #'emms-full-resync :desc "Playlist" "m" #'emms-playlist-mode-go :desc "Play/pause" "SPC" #'emms-pause :desc "Next" "n" #'emms-next @@ -812,6 +846,10 @@ Open a url in a secondary program, in my case ~Vivaldi~ (setq shr-image-animate t) #+end_src +Let's make ~eww~ go into readable mode on page enter. +#+begin_src emacs-lisp + (add-hook 'eww-after-render-hook #'eww-readable) +#+end_src ** Keybindings #+begin_src emacs-lisp (with-eval-after-load 'eww @@ -849,8 +887,9 @@ There's not much config needed except 1 (one) binding :desc "Browse Elpher" "b" #'elpher-browse-url-elpher) #+end_src * Packages -~The ones that dont belong~ - +#+BEGIN_QUOTE +The ones that dont belong +#+END_QUOTE These packages are (mostly) defined in ~packages.el~ and configured here. ** TODO mosey Mosey lets you ~Mosey down~ (get it?) to different points in a code block. @@ -907,6 +946,51 @@ Then we add bindings for ~eat~ as to not have to run ~M-x~ everytime. :prefix "o" :desc "Open Eat" "e" #'eat-other-window) ; dont steal the current window #+end_src + +** nov.el +#+begin_quote +This is pushing it. +#+end_quote + +nov.el is a way to read EPUB's in Emacs! because why buy a kindle if you have GNU? +Requires ~(package! nov)~ in packages.el (doom) +#+begin_src emacs-lisp +(use-package! nov + :mode ("\\.epub\\'" . nov-mode) + :config + (setq nov-text-width 80 + nov-variable-pitch t) + (add-hook 'nov-mode-hook + (lambda () + (face-remap-add-relative 'variable-pitch + :family "Georgia" :height 1.3))) ; different font for reading + (add-hook 'nov-mode-hook #'writeroom-mode) ; center text & stuff + #+end_src + + Now let's add some nov mappings + #+begin_src emacs-lisp + (map! :map nov-mode-map + :n "i" #'nov-scroll-up ; scroll roughly a page up + :n "e" #'nov-scroll-down ; scroll roughly a page down + :n "]" #'nov-next-document + :n "[" #'nov-previous-document + :n "t" #'nov-goto-toc)) +#+end_src + +* Tramp + +Tramp is a way to edit files via SSH and root owned files in Emacs. +This section is purely used to help me with editing root owned files, without calling ~doas emacs~ and losing my config +#+begin_src emacs-lisp +(with-eval-after-load 'tramp + (add-to-list 'tramp-methods + '("doas" + (tramp-login-program "doas") + (tramp-login-args (("-u" "%u") ("-s"))) + (tramp-remote-shell "/bin/sh") + (tramp-remote-shell-args ("-c")) + (tramp-connection-timeout 10)))) +#+end_src * Evil ~Mapping at its finest~ EVIl mode emulates VIM bindings in Emacs. diff --git a/doom/.config/doom/packages.el b/doom/.config/doom/packages.el index ae28272..dacca67 100644 --- a/doom/.config/doom/packages.el +++ b/doom/.config/doom/packages.el @@ -15,4 +15,4 @@ (package! eat) (package! org-modern-indent :recipe (:host github :repo "jdtsmith/org-modern-indent")) -(package! minions) +(package! nov) diff --git a/doom/.config/doom/splash.el b/doom/.config/doom/splash.el index e61adbd..fbb304e 100644 --- a/doom/.config/doom/splash.el +++ b/doom/.config/doom/splash.el @@ -13,8 +13,6 @@ (with-current-buffer buf (let ((inhibit-read-only t)) (erase-buffer) - (when (one-window-p) - (setq mode-line-format nil)) (setq cursor-type nil) (let* ((height (- (window-body-height nil) 1)) (width (window-body-width nil)) |
