doom config updates

This commit is contained in:
Matt Nish-Lapidus 2024-12-07 11:16:25 -05:00
parent f3cfad8f48
commit 20b35a3b70
3 changed files with 190 additions and 141 deletions

View file

@ -1,5 +1,7 @@
;;; bindings.el -*- lexical-binding: t; -*-
(cua-mode +1)
(map! (:when (modulep! :ui popup)
"C-`" #'+popup/toggle
"C-~" #'+popup/raise)
@ -415,28 +417,28 @@
:map lisp-mode-map
:desc "Load cl-patterns helpers" "p" #'cl-patterns-helpers-load)
;; (map! :map smartparens-mode-map
;; "M-[" #'sp-forward-barf-sexp
;; "M-]" #'sp-forward-slurp-sexp
;; "M-{" #'sp-backward-slurp-sexp
;; "M-}" #'sp-backward-barf-sexp
;; "M-)" #'sp-split-sexp
;; "M-(" #'sp-splice-sexp
;; "C-(" #'sp-wrap-round
;; "C-)" #'sp-unwrap-sexp
;; "C-[" #'sp-wrap-square
;; "C-]" #'sp-unwrap-sexp
;; "C-{" #'sp-wrap-curly
;; "C-}" #'sp-unwrap-sexp)
(map! :map smartparens-mode-map
"M-[" #'sp-forward-barf-sexp
"M-]" #'sp-forward-slurp-sexp
"M-{" #'sp-backward-slurp-sexp
"M-}" #'sp-backward-barf-sexp
"M-)" #'sp-split-sexp
"M-(" #'sp-splice-sexp
"C-(" #'sp-wrap-round
"C-)" #'sp-unwrap-sexp
"C-[" #'sp-wrap-square
"C-]" #'sp-unwrap-sexp
"C-{" #'sp-wrap-curly
"C-}" #'sp-unwrap-sexp)
;; platform io local leader bindings
(map! :map platformio-mode-map
:localleader
"b" #'platformio-build
"u" #'platformio-upload
"B" #'platformio-boards
"c" #'platformio-clean
"m" #'platformio-device-monitor)
:localleader
"b" #'platformio-build
"u" #'platformio-upload
"B" #'platformio-boards
"c" #'platformio-clean
"m" #'platformio-device-monitor)
(defun sclang-show-scope ()
(interactive)
@ -451,68 +453,69 @@
(sclang-eval-expression "s.makeGui"))
(map! :map sclang-mode-map
"M-C-x" 'sclang-eval-region-or-line
"M-C-z" 'sclang-server-free-all
:localleader
"b" #'sclang-server-boot
"." #'sclang-main-stop
"l" #'sclang-show-levels
"R" #'sclang-recompile
"s" #'sclang-show-scope
"g" #'sclang-show-gui
"k" #'sclang-kill
"r" #'sclang-server-reboot
"e" #'sclang-eval-region-or-line
"h" #'sclang-find-help
"H" #'sclang-open-help-gui
"s" #'sclang-start)
"M-C-x" 'sclang-eval-region-or-line
"M-C-z" 'sclang-server-free-all
:localleader
"b" #'sclang-server-boot
"." #'sclang-main-stop
"l" #'sclang-show-levels
"R" #'sclang-recompile
"s" #'sclang-show-scope
"g" #'sclang-show-gui
"k" #'sclang-kill
"r" #'sclang-server-reboot
"e" #'sclang-eval-region-or-line
"h" #'sclang-find-help
"H" #'sclang-open-help-gui
"s" #'sclang-start)
(map! :map centaur-tabs-mode-map
"C-M-<right>" 'centaur-tabs-forward
"C-M-<left>" 'centaur-tabs-backward)
(map! :map web-mode-map
"C-S-<" #'web-mode-element-wrap)
"C-S-<" #'web-mode-element-wrap)
(map! :map chezmoi-mode-map
:localleader
"f" #'chezmoi-find
"w" #'chezmoi-write)
:localleader
"f" #'chezmoi-find
"w" #'chezmoi-write)
;; mu4e bindings
(map! :map (list mu4e-main-mode-map mu4e-compose-mode-map mu4e-headers-mode-map mu4e-view-mode-map)
:localleader
:desc "Compose" "c" #'compose-mail
:desc "Search (consult)" "SPC" #'consult-mu
:desc "Search (mu4e)" "f" #'mu4e-search
:desc "Update All" "u" #'mu4e-update-mail-and-index
:desc "Bookmarks" "b" #'mu4e-search-bookmark
:desc "Jump to Maildir" "j" #'mu4e-search-maildir
:desc "Switch Context" ";" #'mu4e-context-switch
:desc "Toggle Overview" "o" #'mu4e-overview)
:localleader
:desc "Compose" "c" #'compose-mail
:desc "Search (consult)" "SPC" #'consult-mu
:desc "Search (mu4e)" "f" #'mu4e-search
:desc "Update All" "u" #'mu4e-update-mail-and-index
:desc "Bookmarks" "b" #'mu4e-search-bookmark
:desc "Jump to Maildir" "j" #'mu4e-search-maildir
:desc "Switch Context" ";" #'mu4e-context-switch
:desc "Toggle Overview" "o" #'mu4e-overview)
(map! :map (list mu4e-view-mode-map mu4e-headers-mode-map)
:localleader
:desc "View Action" "v" #'mu4e-view-action
:desc "Reply All (Wide)" "w" #'mu4e-compose-wide-reply
:desc "Reply" "r" #'mu4e-compose-reply
:desc "Save Attachments" "a" #'mu4e-view-save-attachments)
:localleader
:desc "View Action" "v" #'mu4e-view-action
:desc "Reply All (Wide)" "w" #'mu4e-compose-wide-reply
:desc "Reply" "r" #'mu4e-compose-reply
:desc "Save Attachments" "a" #'mu4e-view-save-attachments
:desc "Save All Attachments" "A" #'mu4e-view-save-all-attachments)
(map! :map mu4e-main-mode-map
"u" #'mu4e-update-mail-and-index)
(map! :map mu4e-headers-mode-map
"v" #'mu4e-view-action
:localleader
:desc "Sort Order" "s" #'mu4e-search-change-sorting)
"v" #'mu4e-view-action
:localleader
:desc "Sort Order" "s" #'mu4e-search-change-sorting)
(map! :map mu4e-compose-mode-map
:localleader
:desc "Send message and exit" "s" #'message-send-and-exit)
:localleader
:desc "Send message and exit" "s" #'message-send-and-exit)
;; dired
(map! :map dired-mode-map
"\\" #'dired-up-directory)
"\\" #'dired-up-directory)
;; obsidian
(map! :leader
@ -548,75 +551,75 @@
;; main meow normal mode keymap
(map! :map meow-normal-state-keymap
"<" #'meow-beginning-of-thing
">" #'meow-end-of-thing
"a" #'meow-append
"A" #'meow-open-below
"b" #'meow-back-word
"B" #'meow-back-symbol
"c" #'meow-change
"d" #'meow-delete
"D" #'meow-backward-delete
"e" #'meow-next-word
"E" #'meow-next-symbol
"f" #'meow-find
"g" #'meow-cancel-selection
"G" #'meow-grab
"h" #'meow-left
"H" #'meow-left-expand
"i" #'meow-insert
"I" #'meow-open-above
"j" #'meow-next
"J" #'meow-next-expand
"k" #'meow-prev
"K" #'meow-prev-expand
"l" #'meow-right
"L" #'meow-right-expand
"m" #'meow-join
"n" #'meow-search
"o" #'meow-block
"O" #'meow-to-block
"p" #'meow-yank
"q" #'meow-quit
"Q" #'meow-goto-line
"r" #'meow-replace
"R" #'meow-swap-grab
"s" #'meow-kill
"t" #'meow-till
"u" #'meow-undo
"U" #'meow-undo-in-selection
"v" #'meow-visit
"w" #'meow-mark-word
"W" #'meow-mark-symbol
"x" #'meow-line
"X" #'meow-goto-line
"y" #'meow-save
"Y" #'meow-sync-grab
"z" #'meow-pop-selection
"0" #'meow-expand-0
"1" #'meow-expand-1
"2" #'meow-expand-2
"3" #'meow-expand-3
"4" #'meow-expand-4
"5" #'meow-expand-5
"6" #'meow-expand-6
"7" #'meow-expand-7
"8" #'meow-expand-8
"9" #'meow-expand-9
"-" #'negative-argument
";" #'meow-reverse
"," #'meow-inner-of-thing
"." #'meow-bounds-of-thing
"/" #'bookmark-in-project-jump
"?" #'bookmark-jump
"÷" #'bookmark-delete
"#" #'string-inflection-all-cycle
"'" #'repeat
"=" #'meow--eval-sexp
"[" #'sp-backward-sexp
"]" #'sp-forward-sexp
"{" #'sp-backward-up-sexp
"}" #'sp-down-sexp
"!" #'meow-start-kmacro-or-insert-counter
"@" #'meow-end-or-call-kmacro
"<escape>" #'corfu-quit)
"<" #'meow-beginning-of-thing
">" #'meow-end-of-thing
"a" #'meow-append
"A" #'meow-open-below
"b" #'meow-back-word
"B" #'meow-back-symbol
"c" #'meow-change
"d" #'meow-delete
"D" #'meow-backward-delete
"e" #'meow-next-word
"E" #'meow-next-symbol
"f" #'meow-find
"g" #'meow-cancel-selection
"G" #'meow-grab
"h" #'meow-left
"H" #'meow-left-expand
"i" #'meow-insert
"I" #'meow-open-above
"j" #'meow-next
"J" #'meow-next-expand
"k" #'meow-prev
"K" #'meow-prev-expand
"l" #'meow-right
"L" #'meow-right-expand
"m" #'meow-join
"n" #'meow-search
"o" #'meow-block
"O" #'meow-to-block
"p" #'meow-yank
"q" #'meow-quit
"Q" #'meow-goto-line
"r" #'meow-replace
"R" #'meow-swap-grab
"s" #'meow-kill
"t" #'meow-till
"u" #'meow-undo
"U" #'meow-undo-in-selection
"v" #'meow-visit
"w" #'meow-mark-word
"W" #'meow-mark-symbol
"x" #'meow-line
"X" #'meow-goto-line
"y" #'meow-save
"Y" #'meow-sync-grab
"z" #'meow-pop-selection
"0" #'meow-expand-0
"1" #'meow-expand-1
"2" #'meow-expand-2
"3" #'meow-expand-3
"4" #'meow-expand-4
"5" #'meow-expand-5
"6" #'meow-expand-6
"7" #'meow-expand-7
"8" #'meow-expand-8
"9" #'meow-expand-9
"-" #'negative-argument
";" #'meow-reverse
"," #'meow-inner-of-thing
"." #'meow-bounds-of-thing
"/" #'bookmark-in-project-jump
"?" #'bookmark-jump
"÷" #'bookmark-delete
"#" #'string-inflection-all-cycle
"'" #'repeat
"=" #'meow--eval-sexp
"[" #'sp-backward-sexp
"]" #'sp-forward-sexp
"{" #'sp-backward-up-sexp
"}" #'sp-down-sexp
"!" #'meow-start-kmacro-or-insert-counter
"@" #'meow-end-or-call-kmacro
"<escape>" #'corfu-quit)

View file

@ -22,6 +22,13 @@
(setq scroll-preserve-screen-position t)
(setq global-hl-line-modes nil)
(if (daemonp)
(add-hook 'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(scroll-bar-mode -1))))
(scroll-bar-mode -1))
;; (custom-set-faces!
;; '(line-number :foreground "#424242"))
@ -32,7 +39,7 @@
(setq org-directory "~/Documents/Obsidian/Primary")
(use-package! kbd-mode)
(use-package! kbd-mode :defer t)
;; Modeline
;; - add current workspace name
@ -98,7 +105,7 @@
(global-so-long-mode 1)
(after! parinfer-rust-mode
(setq parinfer-rust-auto-download f)
(setq parinfer-rust-auto-download nil)
(setq parinfer-rust-preferred-mode "smart"))
(setq dap-ui-variable-length 200)
@ -236,15 +243,18 @@
(after! gcode-mode
(add-hook! 'gcode-mode-hook 'eldoc-mode))
;; (use-package! tramp
;; :init
;; ;; Make sure we work on remote guixsd machines :)
;; ;; probably only helps if you start on a guixsd machine..!
;; (setq tramp-remote-path
;; (append path-tramp-remote
;; '("~/.guix-profile/bin" "~/.guix-profile/sbin"
;; "/run/current-system/profile/bin"
;; "/run/current-system/profile/sbin"))))
(use-package!
tramp
:defer t
:config
;; To “turn off” the backup feature for remote files and stop TRAMP from saving to the backup directory.
;; See https://www.gnu.org/software/tramp/#Auto_002dsave-File-Lock-and-Backup
(add-to-list 'backup-directory-alist
(cons tramp-file-name-regexp nil))
(customize-set-variable 'tramp-backup-directory-alist backup-directory-alist)
(setq backup-enable-predicate
(lambda (name) nil)))
;; (use-package! ready-player
;; :config

View file

@ -39,6 +39,42 @@
(newline))
(setq message-signature nil))
(defun mu4e-view-save-all-attachments (&optional arg)
"Save all MIME parts from currsent mu4e gnus view buffer."
;; Copied from mu4e-view-save-attachments
(interactive "P")
(cl-assert (and (eq major-mode 'mu4e-view-mode)
(derived-mode-p 'gnus-article-mode)))
(let* ((msg (mu4e-message-at-point))
(id (cleanse-subject (mu4e-message-field msg :subject)))
(attachdir (concat bulk-saved-attachments-dir "/" id))
(parts (mu4e--view-gather-mime-parts))
(handles '())
(files '())
dir)
(mkdir attachdir t)
(dolist (part parts)
(let ((fname (or
(cdr (assoc 'filename (assoc "attachment" (cdr part))))
(seq-find #'stringp
(mapcar (lambda (item) (cdr (assoc 'name item)))
(seq-filter 'listp (cdr part)))))))
(when fname
(push `(,fname . ,(cdr part)) handles)
(push fname files))))
(if files
(progn
(setq dir
(if arg (read-directory-name "Save to directory: ")
attachdir))
(cl-loop for (f . h) in handles
when (member f files)
do (mm-save-part-to-file h
(sje-next-free
(expand-file-name f dir)))))
(mu4e-message "No attached files found"))))
(use-package! consult-mu
:defer-incrementally mu4e
:custom