[emacs] A little cleanup

This commit is contained in:
2022-10-03 17:08:04 -04:00
parent 38abe55e5b
commit 0b3f30971c
2 changed files with 28 additions and 85 deletions

View File

@ -4,13 +4,15 @@ This configuration of Emacs is highly opinionated.
* Basics * Basics
My identity. Used in a handful of places in Emacs to pre-populate authorship and such. My identity. Used in a handful of places in Emacs to pre-populate authorship and such.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq user-full-name "Colin Powell" (setq user-full-name "Colin Powell"
user-mail-address "colin@unbl.ink") user-mail-address "colin@unbl.ink")
#+END_SRC #+END_SRC
From a friend at [[https://discord.com/channels/406534637242810369/695450585758957609/715126265715097600][Discord]] From a friend at [[https://discord.com/channels/406534637242810369/695450585758957609/715126265715097600][Discord]]
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq ivy-read-action-function #'ivy-hydra-read-action) ;;(setq ivy-read-action-function #'ivy-hydra-read-action)
#+END_SRC #+END_SRC
* User interface * User interface
** Fonts and themes ** 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 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. for it's retro charm. Nimbus just doesn't look great when I'm tired though.
#+BEGIN_SRC emacs-lisp #+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-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-big-font (font-spec :family "JetBrains Mono" :size 16 :weight 'regular)
doom-variable-pitch-font (font-spec :family "Overpass" :size 12)) 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 in eww" "3" #'eww-search-words
:desc "Search all the things" "g" #'deadgrep)) :desc "Search all the things" "g" #'deadgrep))
#+END_SRC #+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 * Music
Right now, just make sure I can connect to my local Mopidy server via MPDel. 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) (define-key global-map "\M-z" 'unfill-paragraph)
#+END_SRC #+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! 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]] 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) (add-to-list 'flycheck-checkers 'vale 'append)
#+END_SRC #+END_SRC
We love auto-formatting, but not everything should be auto-formatted
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq +format-on-save-enabled-modes (setq +format-on-save-enabled-modes
'(not emacs-lisp-mode ; elisp's mechanisms are good enough '(not emacs-lisp-mode ; elisp's mechanisms are good enough
sql-mode ; sqlformat is currently broken sql-mode ; sqlformat is currently broken
tex-mode ; latexindent is broken tex-mode ; latexindent is broken
org-mode org-mode
html-mode
latex-mode)) latex-mode))
#+end_src #+end_src
* Org-mode * Org-mode
** Basic configuration ** Basic configuration
A handful of mods here clean up org mode. Line numbers dont mean much when A handful of mods here clean up org mode. Line numbers dont mean much when
@ -216,26 +191,13 @@ a serif font when Im writing a lot of words.
(add-hook 'org-mode-hook #'doom-disable-line-numbers-h) (add-hook 'org-mode-hook #'doom-disable-line-numbers-h)
(after! org (after! org
(run-with-idle-timer 300 t (lambda () ((save-window-excursion org-agenda) nil "a")) )
(setq org-directory (expand-file-name "~/var/org/") (setq org-directory (expand-file-name "~/var/org/")
org-agenda-files (file-expand-wildcards "~/var/org/2022-*") 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-ellipsis ""
org-image-actual-width '(600) org-image-actual-width '(600)
org-protocol-default-template-key "l" org-fontify-quote-and-verse-blocks t
org-capture-templates org-agenda-dim-blocked-tasks nil
'(("i" "Send to inbox" entry (file "~/var/org/index.org") org-pretty-entities t
"* 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-fancy-priorities-list '("🅰" "🅱" "🅲" "🅳" "🅴") org-fancy-priorities-list '("🅰" "🅱" "🅲" "🅳" "🅴")
org-modules '(ol-eshell org-modules '(ol-eshell
ol-notmuch ol-notmuch
@ -244,18 +206,16 @@ a serif font when Im writing a lot of words.
ob-http ob-http
org-id))) org-id)))
;; Dont 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 ;; Refiling
(setq org-refile-targets '(("~/var/org/index.org" :maxlevel . 9))) (setq org-refile-targets '(("~/var/org/index.org" :maxlevel . 9))
(setq org-outline-path-complete-in-steps nil) ; Refile in a single go org-outline-path-complete-in-steps nil ; Refile in a single go
(setq org-refile-use-outline-path t) ; Show full paths for refiling org-refile-use-outline-path t) ; Show full paths for refiling
#+END_SRC #+END_SRC
** Key bindings ** 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 #+BEGIN_SRC emacs-lisp
(setq +inbox-file "~/var/org/index.org") (setq +inbox-file "~/var/org/index.org")
(defun +open-inbox-file () (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 :leader
:desc "Open inbox" "I" #'+open-inbox-file :desc "Open inbox" "I" #'+open-inbox-file
:desc "Save all org buffers" "A" #'org-save-all-org-buffers) :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 #+END_SRC
** Org-roam ** 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 #+BEGIN_SRC emacs-lisp
(setq org-roam-directory "~/var/org/") (setq org-roam-directory "~/var/org/")
(setq org-roam-dailies-directory "") (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"))) :head "#+title: %<%Y-%m-%d>\n\n")))
#+END_SRC #+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 * Novel
Reading novels in Emacs, how novel! Reading novels in Emacs, how novel!
#+BEGIN_SRC emacs-lisp #+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 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. are closed. Then we set our auto save directory and generic message directory.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq message-kill-buffer-on-exit t) (setq message-kill-buffer-on-exit t)
(setq message-auto-save-directory "~/Mail/colin@unbl.ink/Drafts/") (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")) "gc" "magit-commit"))
#+END_SRC #+END_SRC
* Coding * Coding
LSP doesn't like big projects and I can't blame it. This forces it to index huge LSP doesn't like big projects and I can't blame it. This forces it to index huge
projects without warning us everytime. projects without warning us everytime.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq lsp-lens-enable 1 (setq lsp-lens-enable 1
lsp-ui-sideline-enable 1 lsp-ui-sideline-enable 1
@ -437,16 +378,17 @@ projects without warning us everytime.
) )
#+END_SRC #+END_SRC
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package lsp-mode (use-package lsp-mode
:commands lsp :commands lsp
:ensure t
:diminish lsp-mode :diminish lsp-mode
:hook :hook
(elixir-mode . lsp) (elixir-mode . lsp)
:init :init
(add-to-list 'exec-path "~/.emacs.d/var/elixir-ls")) (add-to-list 'exec-path "~/.emacs.d/var/elixir-ls"))
#+end_src #+end_src
* Mastodon * Mastodon
There's gotta be a way to get the token out of password-store for this. There's gotta be a way to get the token out of password-store for this.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp

View File

@ -16,6 +16,7 @@
;; python stuffs ;; python stuffs
(package! blacken) (package! blacken)
(package! poetry)
;; org stuffs ;; org stuffs
(package! ob-http) (package! ob-http)