This commit is contained in:
Jeffrey Serio 2023-08-09 20:02:01 -05:00
parent 07fbb7893a
commit 5e0471dd65
3 changed files with 146 additions and 143 deletions

223
config.el
View File

@ -9,16 +9,24 @@
;; See 'C-h v doom-font' for documentation and more examples of what they ;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example: ;; accept. For example:
(when (string= (system-name) "moonshadow") (when (string= (system-name) "moonshadow")
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size 16) (setq fontsize 18)
doom-variable-pitch-font (font-spec :family "Rubik") (setq default-frame-alist
doom-unicode-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size 16) '((height . 53)
doom-big-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size 16))) (width . 154)
(left . 1720)
(top . 0)
(vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil))))
(when (string= (system-name) "evergloam") (when (string= (system-name) "evergloam")
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size 18) (setq fontsize 18)
doom-variable-pitch-font (font-spec :family "Rubik") (add-to-list 'default-frame-alist '(fullscreen . maximized)))
doom-unicode-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size 18)
doom-big-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size 18))) (setq doom-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size fontsize)
doom-variable-pitch-font (font-spec :family "Rubik")
doom-unicode-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size fontsize)
doom-big-font (font-spec :family "JetBrainsMono Nerd Font Mono" :size fontsize))
;; Use catppuccin-mocha theme ;; Use catppuccin-mocha theme
(setq doom-theme 'catppuccin) (setq doom-theme 'catppuccin)
@ -101,11 +109,8 @@ If point was already at that position, move point to beginning of line."
'(emacs-lisp-mode '(emacs-lisp-mode
python-mode)) python-mode))
;; open Emacs in a maxmimized window
;; (add-to-list 'default-frame-alist '(fullscreen . maximized))
;;;; evil-nerd-commenter
;;;; Package: evil-nerd-commenter
(global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines) (global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
(global-set-key (kbd "C-c l") 'evilnc-quick-comment-or-uncomment-to-the-line) (global-set-key (kbd "C-c l") 'evilnc-quick-comment-or-uncomment-to-the-line)
@ -113,7 +118,9 @@ If point was already at that position, move point to beginning of line."
(global-set-key (kbd "C-c p") 'evilnc-comment-or-uncomment-paragraphs) (global-set-key (kbd "C-c p") 'evilnc-comment-or-uncomment-paragraphs)
;;;; Package: org ;;;; org-mode
(org-bullets-mode 1)
(setq org-modules '(org-protocol (setq org-modules '(org-protocol
org-agenda org-agenda
@ -125,33 +132,23 @@ If point was already at that position, move point to beginning of line."
(setq org-directory "~/sync/org/") (setq org-directory "~/sync/org/")
(setq org-default-notes-file "~/sync/org/notes.org") (setq org-default-notes-file "~/sync/org/notes.org")
(setq my-org-inbox-file "~/sync/org/inbox.org")
;; support selecting lines by using shift ;; support selecting lines by using shift
(setq org-support-shift-select t) (setq org-support-shift-select t)
;; org-mode tags ;; org-mode tags
(setq org-tag-alist (quote (("@errand" . ?e) (setq org-tag-alist (quote (("@errand" . ?e)
("@homemaking" . ?c) ("@homemaking" . ?m)
("@homelab" . ?h) ("@homelab" . ?l)
("@desktop" . ?d) ("@config" . ?c)
("@selfcare" . ?s) ("@selfcare" . ?s)
("@fedora" . ?f) ("@fedora" . ?f)
("@techne" . ?t)
("@refile" . ?r)))) ("@refile" . ?r))))
;; org-mode keybindings ;; org-mode keybindings
(with-eval-after-load 'org (with-eval-after-load 'org
(bind-key "C-M-w" 'append-next-kill org-mode-map) (bind-key "C-c $" 'org-archive-subtree)
(bind-key "C-TAB" 'org-cycle org-mode-map)
(bind-key "C-c v" 'org-show-todo-tree org-mode-map)
(bind-key "C-c C-r" 'org-refile org-mode-map)
(bind-key "C-c o" 'my-org-follow-entry-link org-mode-map)
(bind-key "C-c d" 'my-org-move-line-to-destination org-mode-map)
(bind-key "C-c t s" 'my-split-sentence-and-capitalize org-mode-map)
(bind-key "C-c t -" 'my-split-sentence-delete-word-and-capitalize org-mode-map)
(bind-key "C-c t d" 'my-delete-word-and-capitalize org-mode-map)
(bind-key "C-c C-p C-p" 'my-org-publish-maybe org-mode-map)
(bind-key "C-c C-r" 'my-org-refile-and-jump org-mode-map)
(bind-key "C-c r" 'org-capture) (bind-key "C-c r" 'org-capture)
(bind-key "C-c R" 'org-roam-capture) (bind-key "C-c R" 'org-roam-capture)
(bind-key "C-c a" 'org-agenda) (bind-key "C-c a" 'org-agenda)
@ -159,32 +156,8 @@ If point was already at that position, move point to beginning of line."
(bind-key "C-c L" 'org-insert-link-global) (bind-key "C-c L" 'org-insert-link-global)
(bind-key "C-c O" 'org-open-at-point-global)) (bind-key "C-c O" 'org-open-at-point-global))
(with-eval-after-load 'org-agenda
(bind-key "i" 'org-agenda-clock-in org-agenda-mode-map))
(setq org-use-effective-time t) (setq org-use-effective-time t)
;; link org subtrees and navigate between them
(defun my-org-follow-entry-link ()
"Follow the defined link for this entry."
(interactive)
(if (org-entry-get (point) "LINK")
(org-link-open-from-string (org-entry-get (point) "LINK"))
(org-open-at-point)))
(defun my-org-link-projects (location)
"Add link properties between the current subtree and the one specified by
LOCATION."
(interactive
(list (let ((org-refile-use-cache nil))
(org-refile-get-location "Location"))))
(let ((link1 (org-store-link nil)) link2)
(save-window-excursion
(org-refile 4 nil location)
(setq link2 (org-store-link nil))
(org-set-property "LINK" link1))
(org-set-property "LINK" link2)))
;; org-refile ;; org-refile
(setq org-reverse-note-order t) ; new notes prepended (setq org-reverse-note-order t) ; new notes prepended
(setq org-refile-use-outline-path 'file) (setq org-refile-use-outline-path 'file)
@ -204,11 +177,6 @@ LOCATION."
"~/sync/org/grocery.org") "~/sync/org/grocery.org")
. (:maxlevel .5)))) . (:maxlevel .5))))
;; makes it easier to cut something and paste it elsewhere in the hierarchy
(with-eval-after-load 'org
(bind-key "C-c k" 'org-cut-subtree org-mode-map)
(setq org-yank-adjusted-subtrees t))
;; org-todo-keywords ;; org-todo-keywords
(with-eval-after-load 'org (with-eval-after-load 'org
(setq org-todo-keywords (setq org-todo-keywords
@ -232,7 +200,7 @@ LOCATION."
(setq org-log-done 'time) (setq org-log-done 'time)
;; ;; Package: org-roam ;;;; org-roam
(setq org-roam-directory "~/sync/org-roam") (setq org-roam-directory "~/sync/org-roam")
(org-roam-db-autosync-mode) (org-roam-db-autosync-mode)
@ -261,27 +229,11 @@ LOCATION."
:target (file "self/${slug}.org") :target (file "self/${slug}.org")
:empty-lines 1 :empty-lines 1
:unnarrowed t) :unnarrowed t)
("c" "recipe" plain ("c" "cookbook" plain
"%?" "* %^{Recipe title}\n :PROPERTIES:\n :source-url:%?\n :servings:\n :prep-time:\n :cook-time:\n :ready-in:\n :END:\n** Ingredients\n \n** Directions\n\n"
:if-new (file+head "recipes/${title}.org" :if-new (file "recipes/${title}.org")
"#+title: ${title}\n#+filetags: :recipe:\n")
:immediate-finish t
:unnarrowed t))) :unnarrowed t)))
;; create the property "type" on my nodes
(cl-defmethod org-roam-node-type ((node org-roam-node))
"Return the TYPE of NODE."
(condition-case nil
(file-name-nondirectory
(directory-file-name
(file-name-directory
(file-relative-name (org-roam-node-file node) org-roam-directory))))
(error "")))
;; modify the display template to show the node "type"
(setq org-roam-node-display-template
(concat "${type:15} ${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
;; org-capture templates ;; org-capture templates
(setq org-capture-templates (setq org-capture-templates
'(("t" "Todo" entry (file "~/sync/org/inbox.org") '(("t" "Todo" entry (file "~/sync/org/inbox.org")
@ -289,7 +241,7 @@ LOCATION."
:empty-lines-before 1 :empty-lines-before 1
:unnarrowed t :unnarrowed t
:immediate-finish t) :immediate-finish t)
("c" "Calendar" entry (file "~/sync/org/calendar.org") ("d" "Calendar" entry (file "~/sync/org/calendar.org")
"* TODO %?" "* TODO %?"
:empty-lines-before 1 :empty-lines-before 1
:unnarrowed t) :unnarrowed t)
@ -301,16 +253,14 @@ LOCATION."
"* %a\n%U\n%^{PROMPT}" "* %a\n%U\n%^{PROMPT}"
:empty-lines-before 1 :empty-lines-before 1
:unnarrowed t :unnarrowed t
:immediate-finish t) :immediate-finish t)))
("s" "Slipbox" entry (file "~/sync/org-roam/inbox.org")
"* %?\n")))
(defun hyperreal/org-capture-slipbox () (defun hyperreal/org-capture-slipbox ()
(interactive) (interactive)
(org-capture nil "s")) (org-capture nil "s"))
;;;; Package: python-mode ;;;; python-mode
;; Set bpython as Python shell interpreter ;; Set bpython as Python shell interpreter
(add-hook! python-mode-hook (add-hook! python-mode-hook
@ -320,7 +270,7 @@ LOCATION."
(setq-hook! 'python-mode-hook +format-with 'black) (setq-hook! 'python-mode-hook +format-with 'black)
;;;; Package: go-mode ;;;; go-mode
;; completion for GoLang ;; completion for GoLang
(add-hook 'completion-at-point-functions 'go-complete-at-point) (add-hook 'completion-at-point-functions 'go-complete-at-point)
@ -335,32 +285,7 @@ LOCATION."
(add-hook 'go-mode-hook #'lsp-deferred) (add-hook 'go-mode-hook #'lsp-deferred)
;;;; Package: yasnippet ;;;; dired
;; Popup rule for yasnippet
(defun yas-popup-isearch-prompt (prompt choices &optional display-fn)
(when (featurep 'popup)
(popup-menu*
(mapcar
(lambda (choice)
(popup-make-item
(or (and display-fn (funcall display-fn choice))
choice)
:value choice))
choices)
:prompt prompt
;; start isearch mode immediately
:isearch t
)))
(setq yas-prompt-functions '(yas-popup-isearch-prompt yas-maybe-ido-prompt yas-completing-prompt yas-no-prompt))
;;;; Package: nov.el, nov-xwidget
(setq nov-variable-pitch nil)
;;;; Package: dired
(after! dired (after! dired
(setq dired-listing-switches "-laGh1v --group-directories-first") (setq dired-listing-switches "-laGh1v --group-directories-first")
@ -370,7 +295,7 @@ LOCATION."
dired-recursive-deletes 'always)) dired-recursive-deletes 'always))
;;;; Package: elfeed ;;;; elfeed
(elfeed-protocol-enable) (elfeed-protocol-enable)
(run-with-idle-timer (* 15 60) t #'elfeed-update) (run-with-idle-timer (* 15 60) t #'elfeed-update)
@ -380,12 +305,13 @@ LOCATION."
:password (shell-command-to-string "echo -n `pass show envs.net/ttrss`")))) :password (shell-command-to-string "echo -n `pass show envs.net/ttrss`"))))
;;;; Package: dictionary ;;;; dictionary
(global-set-key (kbd "C-c l") #'dictionary-lookup-definition) (global-set-key (kbd "C-c l") #'dictionary-lookup-definition)
(setq dictionary-server "dict.org") (setq dictionary-server "dict.org")
;;;; Package: undo-tree ;;;; undo-tree
(use-package undo-tree (use-package undo-tree
:diminish undo-tree-mode :diminish undo-tree-mode
@ -395,3 +321,76 @@ LOCATION."
(setq undo-tree-visualizer-timestamps t) (setq undo-tree-visualizer-timestamps t)
(setq undo-tree-visualizer-diff t) (setq undo-tree-visualizer-diff t)
(setq undo-tree-history-directory-alist '(("." . "~/sync/emacs/backups/undo-tree"))))) (setq undo-tree-history-directory-alist '(("." . "~/sync/emacs/backups/undo-tree")))))
;;;; tab-bar-mode
(global-set-key (kbd "s-{") 'tab-bar-switch-to-prev-tab)
(global-set-key (kbd "s-}") 'tab-bar-switch-to-next-tab)
(global-set-key (kbd "s-t") 'tab-bar-new-tab)
(global-set-key (kbd "s-w") 'tab-bar-close-tab)
(tab-bar-mode 1)
(setq tab-bar-close-button-show nil)
(setq tab-bar-new-tab-choice "*doom*")
(setq tab-bar-tab-hints t)
(setq tab-bar-format '(tab-bar-format-history tab-bar-format-tabs tab-bar-separator))
(setq tab-bar-select-tab-modifiers "super")
;;;; bufler-mode
(setq bufler-tabs-mode 1)
(global-set-key (kbd "C-x b") 'bufler-switch-buffer)
(bufler-defgroups
(group
;; Subgroup collecting all named workspaces.
(auto-workspace))
(group
;; Subgroup collecting all help-mode and info-mode buffers
(group-or "*Help/Info*"
(mode-match "*Help*" (rx bos "help-"))
(mode-match "*Info*" (rx bos "info-"))))
(group
;; Subgroup collecting all special buffers (i.e. ones that are not
;; file-backed), except magit-status-mode buffers (which are allowed to fall
;; through to other groups, so they end up grouped with their project buffers).
(group-and "*Special*"
(lambda (buffer)
(unless (or (funcall (mode-match "Magit" (rx bos "magit-status"))
buffer)
(funcall (mode-match "Dired" (rx bos "dired"))
buffer)
(funcall (auto-file) buffer))
"*Special*")))
(group
;; Subgroup collecting these "special special" buffers
;; separately for convenience.
(name-match "**Special**"
(rx bos "*" (or "Messages" "Warnings" "scratch" "Backtrace") "*")))
(group
;; Subgroup collecting all other Magit buffers, grouped by directory.
(mode-match "*Magit* (non-status)" (rx bos (or "magit" "forge") "-"))
(auto-directory))
;; Remaining special buffers are grouped automatically by mode.
(auto-mode))
;; All buffers under ~/.doom.d
(dir doom-user-dir)
(group
;; Subgroup collecting buffers in org-directory.
(dir org-directory)
(dir org-roam-directory)
(group
;; Subgroup collecting indirect Org buffers, grouping them by file.
;; This is very useful when used with org-tree-to-indirect-buffer.
(auto-indirect)
(auto-file))
(group-not "*special*" (auto-file))
(auto-mode))
(group
;; Subgroup collecting buffers in a version-control project,
;; grouping them by directory.
(auto-project))
;; Group remaining buffers by directory, then major mode.
(auto-directory)
(auto-mode))

33
init.el
View File

@ -22,7 +22,7 @@
:completion :completion
company ; the ultimate code completion backend company ; the ultimate code completion backend
;; helm ; the *other* search engine for love and life ;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine... ;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life ;;ivy ; a search engine for love and life
vertico ; the search engine of the future vertico ; the search engine of the future
@ -43,12 +43,12 @@
;;neotree ; a project drawer, like NERDTree for vim ;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows (popup +defaults) ; tame sudden yet inevitable temporary windows
tabs ; a tab bar for Emacs ;; tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler ;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages ;;unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe (vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows ;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing ;;zen ; distraction-free coding or writing
@ -74,19 +74,20 @@
vc ; version-control and Emacs, sitting in a tree vc ; version-control and Emacs, sitting in a tree
:term :term
eshell ; the elisp shell that works everywhere ;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs ;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs ;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs vterm ; the best terminal emulation in Emacs
:checkers :checkers
syntax ; tasing you for every semicolon you forget syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling (spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make ;;grammar ; tasing grammar mistake every you make
:tools :tools
ansible ansible
;;biblio ; Writes a PhD for you (citation needed) ;;biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
;;debugger ; FIXME stepping through code, to help you add bugs ;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv ;;direnv
docker docker
@ -97,15 +98,15 @@
lookup ; navigate your code and its documentation lookup ; navigate your code and its documentation
lsp ; M-x vscode lsp ; M-x vscode
magit ; a git porcelain for Emacs magit ; a git porcelain for Emacs
make ; run make tasks from Emacs ;;make ; run make tasks from Emacs
pass ; password manager for nerds pass ; password manager for nerds
pdf ; pdf enhancements pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders ;;prodigy ; FIXME managing external services & code builders
rgb ; creating color strings ;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects ;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code ;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux ;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree... ;;tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp ;;upload ; map local to remote projects via ssh/ftp
:os :os
@ -148,12 +149,12 @@
;;latex ; writing papers in Emacs has never been so fun ;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove ;;lean ; for folks with too much to prove
;;ledger ; be audit you can be ;;ledger ; be audit you can be
lua ; one-based indices? one-based indices ;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c ;;nim ; python + lisp at the speed of c
;; nix ; I hereby declare "nix geht mehr!" ;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel ;;ocaml ; an objective camel
(org +pretty) ; organize your plain life in plain text org ; organize your plain life in plain text
;;php ; perl's insecure younger brother ;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more ;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional ;;purescript ; javascript, but functional
@ -161,10 +162,10 @@
;;qt ; the 'cutest' gui framework ever ;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs ;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6 ;;raku ; the artist formerly known as perl6
rest ; Emacs as a REST client ;;rest ; Emacs as a REST client
;;rst ; ReST in peace ;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;; (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good ;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps ;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor sh ; she sells {ba,z,fi}sh shells on the C xor
@ -177,7 +178,7 @@
;;zig ; C, but simpler ;;zig ; C, but simpler
:email :email
;; (mu4e +org) ;;(mu4e +org +gmail)
;;notmuch ;;notmuch
;;(wanderlust +gmail) ;;(wanderlust +gmail)
@ -185,8 +186,8 @@
;;calendar ;;calendar
;;emms ;;emms
;;everywhere ; *leave* Emacs!? You must be joking ;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize ;; irc ; how neckbeards socialize
rss ; emacs as an RSS reader (rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought ;;twitter ; twitter client https://twitter.com/vnought
:config :config

View File

@ -9,23 +9,26 @@
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package) ;(package! some-package)
(package! autothemer) (package! autothemer)
(package! bufler)
(package! catppuccin-theme) (package! catppuccin-theme)
(package! elpher)
(package! gemini :recipe
(:host nil :repo "https://git.carcosa.net/jmcbray/gemini.el"))
(package! python-docstring)
(package! importmagic)
(package! systemd)
(package! license-templates)
(package! shell-pop)
(package! fzf)
(package! evil-nerd-commenter)
(package! just-mode)
(package! justl)
(package! go-complete)
(package! nov)
(package! elfeed-protocol) (package! elfeed-protocol)
(package! elfeed-tube) (package! elfeed-tube)
(package! elfeed-tube-mpv) (package! elfeed-tube-mpv)
(package! undo-tree) (package! elpher)
(package! evil-nerd-commenter)
(package! fzf)
(package! gemini :recipe
(:host nil :repo "https://git.carcosa.net/jmcbray/gemini.el"))
(package! go-complete)
(package! importmagic)
(package! just-mode)
(package! justl)
(package! license-templates)
(package! nov)
(package! org-bullets)
(package! org-chef)
(package! org-roam) (package! org-roam)
(package! python-docstring)
(package! shell-pop)
(package! systemd)
(package! undo-tree)