From 0b3f30971ca50baeeb6708a067212d1252cf95ee Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 3 Oct 2022 17:08:04 -0400 Subject: [PATCH] [emacs] A little cleanup --- emacs/.config/doom/config.org | 112 ++++++++------------------------- emacs/.config/doom/packages.el | 1 + 2 files changed, 28 insertions(+), 85 deletions(-) diff --git a/emacs/.config/doom/config.org b/emacs/.config/doom/config.org index 65eb7ae..b051d20 100644 --- a/emacs/.config/doom/config.org +++ b/emacs/.config/doom/config.org @@ -4,13 +4,15 @@ This configuration of Emacs is highly opinionated. * Basics My identity. Used in a handful of places in Emacs to pre-populate authorship and such. + #+BEGIN_SRC emacs-lisp (setq user-full-name "Colin Powell" user-mail-address "colin@unbl.ink") #+END_SRC + From a friend at [[https://discord.com/channels/406534637242810369/695450585758957609/715126265715097600][Discord]] #+BEGIN_SRC emacs-lisp -(setq ivy-read-action-function #'ivy-hydra-read-action) +;;(setq ivy-read-action-function #'ivy-hydra-read-action) #+END_SRC * User interface ** Fonts and themes @@ -18,7 +20,7 @@ I change my default theme almost as often as the weather. I tend to revert back to Doom One most of the time, but I like the Kaolin themes, as well as Nimbus for it's retro charm. Nimbus just doesn't look great when I'm tired though. #+BEGIN_SRC emacs-lisp -(setq doom-theme 'doom-gruvbox +(setq doom-theme 'doom-one doom-font (font-spec :family "FuraCode Nerd Font Mono" :size 12 :weight 'regular) doom-big-font (font-spec :family "JetBrains Mono" :size 16 :weight 'regular) doom-variable-pitch-font (font-spec :family "Overpass" :size 12)) @@ -76,20 +78,6 @@ border. :desc "Search in eww" "3" #'eww-search-words :desc "Search all the things" "g" #'deadgrep)) #+END_SRC -* Weather -Wttrin is a pretty funny way to check weather. I like that you can copy and -paste fun a ASCII representations of the day's weather. It's not terribly -accurate though. - -#+BEGIN_SRC emacs-lisp -(setq wttrin-default-cities '("Castine, ME" "San Francisco" "Thessaloniki")) -(setq wttrin-default-accept-language '("Accept-Language" . "en-US")) - -(map! - (:leader - (:prefix "o" - :desc "(W)eather" "W" #'wttrin))) -#+END_SRC * Music Right now, just make sure I can connect to my local Mopidy server via MPDel. @@ -167,23 +155,6 @@ Here we define the opposite function to fill-paragraph and then map it to Meta-z (define-key global-map "\M-z" 'unfill-paragraph) #+END_SRC -PlantUML is pretty fantastic. This enables a mode for editing plantuml files in Emacs. -#+BEGIN_SRC emacs-lisp -;; PlantUML is awesome for quick diagrams -(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode)) -#+END_SRC - -Handy clock to look up what timezone my co-workers are in! -#+BEGIN_SRC emacs-lisp -;; Timezone location strings at http://worldtime.io -(setq display-time-world-list '(("America/Los_Angeles" "San Francisco") - ("America/Tegucigalpa" "Tegucigalpa") - ("America/New_York" "New York") - ("Europe/London" "London") - ("Europe/Warsaw" "Warsaw") - ("Europe/Kiev" "Lviv"))) -#+END_SRC - Vale linter, a more up to date proselint! How I went about [[file:/usr/home/powellc/var/org/20200916134500-vale_prose_linter.org::*Installing Vale][installing Vale]] @@ -199,14 +170,18 @@ How I went about [[file:/usr/home/powellc/var/org/20200916134500-vale_prose_lint ) (add-to-list 'flycheck-checkers 'vale 'append) #+END_SRC + +We love auto-formatting, but not everything should be auto-formatted #+begin_src emacs-lisp (setq +format-on-save-enabled-modes '(not emacs-lisp-mode ; elisp's mechanisms are good enough sql-mode ; sqlformat is currently broken tex-mode ; latexindent is broken org-mode + html-mode latex-mode)) #+end_src + * Org-mode ** Basic configuration A handful of mods here clean up org mode. Line numbers don’t mean much when @@ -216,26 +191,13 @@ a serif font when I’m writing a lot of words. (add-hook 'org-mode-hook #'doom-disable-line-numbers-h) (after! org - (run-with-idle-timer 300 t (lambda () ((save-window-excursion org-agenda) nil "a")) ) (setq org-directory (expand-file-name "~/var/org/") org-agenda-files (file-expand-wildcards "~/var/org/2022-*") - org-pretty-entities t - org-agenda-dim-blocked-tasks nil - org-log-done 'time - org-hide-emphasis-markers t - org-fontify-whole-heading-line t - org-fontify-done-headline t - org-fontify-quote-and-verse-blocks t org-ellipsis "…" org-image-actual-width '(600) - org-protocol-default-template-key "l" - org-capture-templates - '(("i" "Send to inbox" entry (file "~/var/org/index.org") - "* TODO %?\n") - ("l" "Link" entry (file "~/var/org/index.org") - "* TODO %a\n %?\n %i")) - org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "WAITING(w)" "|" "DONE(d)")) + org-fontify-quote-and-verse-blocks t + org-agenda-dim-blocked-tasks nil + org-pretty-entities t org-fancy-priorities-list '("🅰" "🅱" "🅲" "🅳" "🅴") org-modules '(ol-eshell ol-notmuch @@ -244,18 +206,16 @@ a serif font when I’m writing a lot of words. ob-http org-id))) -;; Don’t display git gutter in org mode -;; With tree folding, it's pretty much useless -(after! git-gutter - (setq git-gutter:disabled-modes '(org-mode image-mode))) - ;; Refiling -(setq org-refile-targets '(("~/var/org/index.org" :maxlevel . 9))) -(setq org-outline-path-complete-in-steps nil) ; Refile in a single go -(setq org-refile-use-outline-path t) ; Show full paths for refiling +(setq org-refile-targets '(("~/var/org/index.org" :maxlevel . 9)) + org-outline-path-complete-in-steps nil ; Refile in a single go + org-refile-use-outline-path t) ; Show full paths for refiling #+END_SRC + ** Key bindings -I add only two custom mappings to the default org mode maps, a shortcut to my Inbox file and a quick way to save all open org mode files. +I add only two custom mappings to the default org mode maps, a shortcut to my +Inbox file and a quick way to save all open org mode files. + #+BEGIN_SRC emacs-lisp (setq +inbox-file "~/var/org/index.org") (defun +open-inbox-file () @@ -267,24 +227,12 @@ I add only two custom mappings to the default org mode maps, a shortcut to my In :leader :desc "Open inbox" "I" #'+open-inbox-file :desc "Save all org buffers" "A" #'org-save-all-org-buffers) -#+END_SRC -** Agenda configuration -#+BEGIN_SRC emacs-lisp -(setq org-agenda-span 3 - org-agenda-start-day "1d") -;(defun +show-agenda () -; (interactive) -; (delete-other-windows) -; (with-popup-rules! nil -; (org-agenda-list) -; (calendar)) -; (other-window 1) -; (split-window-vertically) -; (other-window 1) -; (find-file +todo-file)) + #+END_SRC ** Org-roam -I am absolutely in love with [[https://org-roam.readthedocs.io/en/develop/][Org-roam]]. Everything about it makes taking notes easier. I just need to level up with Zettels and web publishing of my notes. +I am absolutely in love with [[https://org-roam.readthedocs.io/en/develop/][Org-roam]]. Everything about it makes taking notes +easier. I just need to level up with Zettels and web publishing of my notes. + #+BEGIN_SRC emacs-lisp (setq org-roam-directory "~/var/org/") (setq org-roam-dailies-directory "") @@ -297,16 +245,6 @@ I am absolutely in love with [[https://org-roam.readthedocs.io/en/develop/][Org- :head "#+title: %<%Y-%m-%d>\n\n"))) #+END_SRC -#+RESULTS: -: / - -** Org-fc -Trying a new space-repetition framework. -#+BEGIN_SRC emacs-lisp -(setq org-fc-directories "~/var/org/") -;(require 'org-fc-hydra) -#+END_SRC - * Novel Reading novels in Emacs, how novel! #+BEGIN_SRC emacs-lisp @@ -362,6 +300,7 @@ somehow installed on your machine. A few nice to haves for messages. First we kill email message buffers when they are closed. Then we set our auto save directory and generic message directory. + #+BEGIN_SRC emacs-lisp (setq message-kill-buffer-on-exit t) (setq message-auto-save-directory "~/Mail/colin@unbl.ink/Drafts/") @@ -423,8 +362,10 @@ Handful of fun aliases to make working in Eshell almost like a /real/ shell :smi "gc" "magit-commit")) #+END_SRC * Coding + LSP doesn't like big projects and I can't blame it. This forces it to index huge projects without warning us everytime. + #+begin_src emacs-lisp (setq lsp-lens-enable 1 lsp-ui-sideline-enable 1 @@ -437,16 +378,17 @@ projects without warning us everytime. ) #+END_SRC + #+begin_src emacs-lisp (use-package lsp-mode :commands lsp - :ensure t :diminish lsp-mode :hook (elixir-mode . lsp) :init (add-to-list 'exec-path "~/.emacs.d/var/elixir-ls")) #+end_src + * Mastodon There's gotta be a way to get the token out of password-store for this. #+BEGIN_SRC emacs-lisp diff --git a/emacs/.config/doom/packages.el b/emacs/.config/doom/packages.el index d1cbb1b..10482a6 100644 --- a/emacs/.config/doom/packages.el +++ b/emacs/.config/doom/packages.el @@ -16,6 +16,7 @@ ;; python stuffs (package! blacken) +(package! poetry) ;; org stuffs (package! ob-http)