Update Doom config

This commit is contained in:
Shawn Borton 2024-02-12 19:07:55 -06:00
parent 6f62dd06e3
commit e63b83a61b
3 changed files with 451 additions and 30 deletions

259
config.el
View file

@ -3,6 +3,28 @@
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Sane defaults
(defvar is-archie-p (equal (system-name) "archie"))
(defvar is-macos-p (equal (system-name) "Shawns-Macbook-Pro.local"))
(setq-default window-combination-resize t)
(setq global-auto-revert-non-file-buffers t)
(setq undo-limit 80000000 ; Raise undo-limit to 80Mb
evil-want-fine-undo t ; By default, all changes while in insert mode are one big blob. Make it granular.
password-cache-expiry nil ; Trust your computers.
scroll-margin 2 ; It's nice to maintain a little margin
window-resize-pixelwise t
)
(setq auth-sources "~/.authinfo.gpg")
(display-time-mode 1)
(global-subword-mode 1)
(electric-pair-mode t)
(setq-default major-mode 'org-mode)
(setq-default line-spacing 10)
;; Enabled inline static analysis
(add-hook 'prog-mode-hook #'flymake-mode)
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
@ -25,24 +47,27 @@
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(use-package! all-the-icons)
(setq doom-font (font-spec :family "Fira Code" :style "Retina" :size 16)
doom-variable-pitch-font (font-spec :family "Baskerville" :size 18)
doom-big-font (font-spec :family "Fira Code" :style "Retina" :size 28))
;;(use-package! all-the-icons)
(setq doom-font (font-spec :family "JetBrains Mono" :style "Regular" :size 14)
doom-variable-pitch-font (font-spec :family "JetBrains Mono" :size 18)
doom-big-font (font-spec :family "JetBrains Mono" :style "Regular" :size 26))
(defvar sb-org-font (font-spec :family "Source Code Pro" :style "Regular" :size 14))
(setq doom-theme 'doom-nord)
(after! doom-themes
;;(load-theme 'doom-nano-dark t)
(setq doom-themes-enable-bold t
doom-themes-enable-italic t))
(map! :leader
:desc "Load new theme"
"h t" #'counsel-load-theme)
(setq-default major-mode 'org-mode)
(setq-default line-spacing 10)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type 'relative)
(setq doom-fallback-buffer-name "► Doom"
+doom-dashboard-name "► Doom")
(setq which-key-idle-delay 0.5) ;; Faster popups
(use-package! all-the-icons-dired)
@ -62,7 +87,7 @@
evil-split-window-below t)
(defadvice! prompt-for-buffer (&rest _)
:after '(evil-window-split evil-window-vsplit)
(+ivy/switch-buffer))
(consult-buffer))
(setq +ivy-buffer-preview t)
;; Here are some additional functions/macros that could help you configure Doom:
@ -84,10 +109,32 @@
;;
;; Make 'h' and 'l' go back and forward in dired. Much faster to navigate the directory structure!
(evil-define-key 'normal dired-mode-map
(kbd "M-RET") 'dired-display-file
(kbd "h") 'dired-up-directory
(kbd "l") 'dired-open-file) ; use dired-find-file instead if not using dired-open package
(kbd "l") 'dired-open-file ; use dired-find-file instead if not using dired-open package
(kbd "m") 'dired-mark
(kbd "t") 'dired-toggle-marks
(kbd "u") 'dired-unmark
(kbd "C") 'dired-do-copy
(kbd "D") 'dired-do-delete)
(evilem-default-keybindings "SPC")
(defun sbinfo/thunar-current-dir ()
"Open the current directory in Thunar."
(interactive)
(let ((default-directory (if (buffer-file-name)
(file-name-directory (buffer-file-name))
default-directory)))
(start-process "Thunar" nil "thunar" default-directory)))
(defun sbinfo/my-find-file-with-pattern (dir pattern)
"Find files containing PATTERN in directory DIR and open them."
(interactive "DEnter directory: \nsEnter pattern: ")
(let* ((files (directory-files dir))
(matches (seq-filter (lambda (f) (string-match-p pattern f)) files)))
(dolist (filename matches)
(find-file (concat (file-name-as-directory dir) filename)))))
;; EWW Stuff
(setq browse-url-browser-function 'eww-browse-url)
(map! :leader
@ -112,6 +159,14 @@
:desc "Open directory in neotree"
"d n" #'neotree-dir)
;; Development keybindings
(map! :leader
:desc "npm install"
"c n i" #'npm-mode-npm-install
:leader
:desc "npm run"
"c n r" #'npm-mode-npm-run)
;; (map! :leader
;; :desc "Edit agenda file"
;; "- a" #'(lambda () (interactive) (find-file "~/Org/agenda.org"))
@ -137,6 +192,40 @@
(setq twittering-icon-mode t)
;; RSS (elfeed)
(after! elfeed
;;(elfeed-org)
;;(setq rmh-elfeed-org-files (list "~/Dropbox/Org/feedly.org"))
(setq elfeed-use-curl t)
(setq elfeed-protocol-fever-update-unread-only t)
(setq elfeed-protocol-feeds (list
(list "fever+https://shawnb@rss.onionpatch.cloud"
:api-url "https://rss.onionpatch.cloud/api/fever.php"
:password ")9vwibuQmv9pr"
:autotags '(("https://www.axios.com" news)("Hacker News" technology)))))
;; enable elfeed-protocol
(setq elfeed-protocol-enabled-protocols '(fever))
(elfeed-protocol-enable)
(elfeed-set-timeout 36000)
(use-package! elfeed-link))
(setq freshrss-hostname "https://rss.onionpatch.cloud")
(setq main-elfeed-feed "https://shawnb@rss.onionpatch.cloud/api/fever.php")
(defun freshrss-network-connection-p ()
(not (condition-case nil
(delete-process
(make-network-process
:name freshrss-hostname
:host "elpa.gnu.org"
:service 443))
(error t))))
(defun elfeed-full-update ()
(interactive)
(if (freshrss-network-connection-p) (delete-directory "~/.cache/doom/elfeed" t))
(setq elfeed-db nil)
;; (elfeed-protocol-fever-update main-elfeed-feed))
(elfeed-update))
(map! :map 'elfeed-search-mode-map :desc "Update elfeed" :n "g R" #'elfeed-full-update)
(map! :leader
:desc "Launch Elfeed"
"r r" #'elfeed
@ -145,14 +234,50 @@
"r u" #'elfeed-update
:leader
:desc "Get Culture items"
"r c" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +culture"))
"r c" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +Culture"))
:leader
:desc "Get default search"
"r d" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread "))
:leader
:desc "Get Hacker News items"
"r h" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread =Hacker"))
:leader
:desc "Add entry to Pocket"
"r k e" #'(lambda () (interactive) (pocket-reader-elfeed-entry-add-link))
:leader
:desc "Add search item to Pocket"
"r k s" #'(lambda () (interactive) (pocket-reader-elfeed-search-add-link))
:leader
:desc "Get News items"
"r n e" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +News"))
:leader
:desc "Get Nitters"
"r n i" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +Nitters"))
:leader
:desc "Get Technology items"
"r t" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +Technology"))
:leader
:desc "Get Videos"
"r v" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +Videos"))
:leader
:desc "Get Writing items"
"r w" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +writing")))
(after! elfeed
(elfeed-org)
(setq rmh-elfeed-org-files (list "~/Dropbox/Org/feedly.org"))
(use-package! elfeed-link))
"r w" #'(lambda () (interactive) (elfeed-search-set-filter "@1-week-ago +unread +Writing")))
(use-package! elfeed-goodies
:init
(elfeed-goodies/setup)
:config
(setq elfeed-goodies/entry-pane-size 0.75))
(add-hook 'elfeed-show-mode-hook 'visual-line-mode)
(evil-define-key 'normal elfeed-show-mode-map
(kbd "J") 'elfeed-goodies/split-show-next
(kbd "K") 'elfeed-goodies/split-show-prev)
(evil-define-key 'normal elfeed-search-mode-map
(kbd "RET") 'elfeed-goodies/split-search-show-entry
(kbd "J") 'elfeed-goodies/split-show-next
(kbd "K") 'elfeed-goodies/split-show-prev)
(setq elfeed-goodies/entry-pane-position 'bottom)
(setq elfeed-search-filter "@1-week-ago +unread "
elfeed-search-title-min-width 80)
@ -198,8 +323,12 @@
;; select a region
;; ⌘-i
(require 'osx-browse)
(osx-browse-mode 1)
;;(require 'osx-browse)
;;(osx-browse-mode 1)
;; (after! pocket-reader
;; (map! :map pocket-reader-mode-map
;; "ta" #'pocket-reader-add-tags))
(defun writing-mode ()
(interactive)
@ -213,7 +342,7 @@
display-line-numbers nil))
(add-hook 'markdown-mode-hook 'writing-mode)
(setq ispell-program-name "/usr/local/bin/aspell")
(setq ispell-program-name "/usr/bin/aspell")
(setq ispell-list-command "--list")
(defun sbinfo/org-mode-setup ()
@ -225,17 +354,18 @@
(defun sbinfo/org-font-setup ()
;; Set faces for heading levels
(dolist (face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(dolist (face '((org-level-1 . 1.3)
(org-level-2 . 1.2)
(org-level-3 . 1.1)
(org-level-4 . 1.0)
(org-level-5 . 1.0)
(org-level-6 . 1.0)
(org-level-7 . 1.0)
(org-level-8 . 1.0)))
(set-face-attribute (car face) nil :font "Courier Prime" :weight 'regular :height (cdr face))))
;; (set-face-attribute (car face) nil :font "JetBrains Mono" :weight 'regular :height (cdr face))))
;; (set-face-attribute (car face) nil :font "Fira Code Retina" :weight 'regular :height (cdr face))))
;; (set-face-attribute (car face) nil :font "Source Code Pro" :weight 'regular :height (cdr face)))
(set-face-attribute (car face) nil :font "Source Code Pro" :height (cdr face))))
;; Ensure that anything that should be fixed-pitch in Org files appears that way
;; (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
@ -246,16 +376,31 @@
;; (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
;; (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
(defvar sbinfo/open-ai-key "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")
(after! chatgpt-shell
(setq chatgpt-shell-openai-key sbinfo/open-ai-key))
(after! org-ai
(add-hook 'org-mode-hook #'org-ai-mode)
(org-ai-install-yasnippets)
(setq org-ai-use-auth-source nil)
(setq org-ai-openai-api-token sbinfo/open-ai-key))
(use-package! gptel
:config
(setq! gptel-api-key sbinfo/open-ai-key))
(after! org
(add-hook 'org-mode-hook #'sbinfo/org-mode-setup)
(setq org-directory "~/Dropbox/Org/"
org-agenda-files '("agenda.org" "algopear.org" "goals.org")
(setq org-directory "~/org/"
org-agenda-files '("agenda.org" "goals_2024.org" "job_search_2022.org")
org-agenda-start-with-follow-mode t
org-default-notes-file (expand-file-name "notes.org" org-directory)
org-ellipsis " ▼ "
org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●")
org-indent-indentation-per-level 4
org-log-done 'time
org-roam-directory "~/Org/roam/"
org-roam-directory "~/org/roam/"
;;org-journal-dir "~/Dropbox/Org/journal/"
;;org-journal-date-format "%B %d, %Y (%A) "
;;org-journal-file-format "%Y-%m-%d.org"
@ -274,12 +419,74 @@
"WAIT(w)" ; Something is holding up this task
"|" ; The pipe necessary to separate "active" states and "inactive" states
"DONE(d)" ; Task has been completed
"CANCELLED(c)" ))) ; Task has been cancelled
"CANCELLED(c)" )) ; Task has been cancelled
org-capture-templates
'(("b" "Bookmark" entry
(file "~/org/bookmarksv2.org")
"* %^{title}\n#+date: %U\n- URL: %^{link}\n- Context: %?")
("t" "Personal todo" entry
(file+headline "~/org/agenda.org" "Inbox")
"* [ ] %?\n%i\n%a")
("n" "Personal notes" entry
(file+headline "~/org/notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t)))
;;("j" "Journal" entry
;;(file+olp+datetree +org-capture-journal-file)
;;"* %U %?\n%i\n%a" :prepend t)))
(sbinfo/org-font-setup))
(use-package! websocket
:after org-roam)
(use-package! org-roam-ui
:after org
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
(defun sbinfo/split-and-indirect-orgtree ()
"Splilts window to the right and opens an org tree section in it."
(interactive)
(split-window-right)
(windmove-right)
(org-tree-to-indirect-buffer))
(defun sbinfo/kill-and-unsplit-orgtree ()
"Kill the cloned buffer and deletes the window."
(interactive)
(kill-this-buffer)
(delete-window))
;; (require 'org-similarity)
;; (use-package! org-similarity
;; :config
;; (setq org-similarity-directory org-roam-directory))
;; (add-load-path! "~/.emacs.d/.local/straight/repos/org-similarity")
;; (require 'org-similarity)
;; (setq org-similarity-python-interpreter "/home/shawnb/.emacs.d/.local/straight/repos/org-similarity/venv/bin/python")
;; (setq org-similarity-directory org-roam-directory)
;; to turn off confirmations
(setq browse-url-dwim-always-confirm-extraction nil)
;; Todoist
(setq todoist-token "344745a4ca6497cbce38cc957cad0c59c5d91613")
;; Auto create directories recursively
;; See https://emacsredux.com/blog/2022/06/12/auto-create-missing-directories/
(defun er-auto-create-missing-dirs ()
(let ((target-dir (file-name-directory buffer-file-name)))
(unless (file-exists-p target-dir)
(make-directory target-dir t))))
(add-to-list 'find-file-not-found-functions #'er-auto-create-missing-dirs)
;; ACe Window
(global-set-key (kbd "M-o") 'ace-window)
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))

197
init.el Normal file
View file

@ -0,0 +1,197 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
;;ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
;;vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
(spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
(lsp +eglot) ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
;;(:if IS-MAC macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
;;(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
;;json ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org
+pretty
+hugo
+roam2) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
(python +lsp +pyright) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
yaml ; JSON, but readable
;;zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
rss ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))

View file

@ -48,14 +48,31 @@
;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)
(unpin! org-roam)
(unpin! straight)
(package! all-the-icons-dired)
(package! chatgpt-shell
:recipe (:host github
:repo "xenodium/chatgpt-shell"))
(package! counsel-osx-app)
(package! doom-nano-modeline
:recipe (:host github
:repo "ronisbr/doom-nano-modeline"))
(package! elfeed)
(package! elfeed-goodies)
(package! elfeed-org)
;;(package! elfeed-org)
(package! elfeed-protocol)
(package! ement)
(package! gptel)
(package! org-ai)
(package! org-bullets)
(package! osx-browse)
(package! reveal-in-osx-finder)
(package! org-roam-ui)
(package! org-similarity
:recipe (:host github
:repo "brunoarine/org-similarity"
:branch "main"))
(package! org-web-tools :pin "8f8b5c6")
(package! pocket-reader :pin "5354082")
(package! todoist)
(package! twittering-mode)
(package! wc-mode)