Files
dotfiles/emacs/.config/doom/config.el
2023-11-27 10:36:08 +01:00

135 lines
4.5 KiB
EmacsLisp

;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
(setq user-full-name "Colin Powell"
user-mail-address "colin@unbl.ink")
(add-to-list 'load-path "~/.config/doom/")
(pixel-scroll-precision-mode t)
(nyan-mode) ;; progress in the form of a rainbow cat.
(setq doom-theme 'doom-one
doom-font (font-spec :family "Iosevka" :size 14 :weight 'regular)
doom-big-font (font-spec :family "Iosevka" :size 18 :weight 'regular)
doom-variable-pitch-font (font-spec :family "Overpass" :size 12))
(add-hook 'after-init-hook #'global-emojify-mode) ;; emojis?!
(add-hook 'prog-mode-hook #'goto-address-mode) ;; linify links!
(map! ;; Easier window movement
:n "C-h" 'evil-window-left
:n "C-j" 'evil-window-down
:n "C-k" 'evil-window-up
:n "C-l" 'evil-window-right
(:map evil-treemacs-state-map
"C-h" 'evil-window-left
"C-l" 'evil-window-right))
(defun unfill-paragraph ()
"Takes a multi-line paragraph and makes it into a single line of text."
(interactive)
(let ((fill-column (point-max)))
(fill-paragraph nil)))
(define-key global-map "\M-z" 'unfill-paragraph)
(defun file-notify-rm-all-watches ()
"Remove all existing file notification watches from Emacs."
(interactive)
(maphash
(lambda (key _value)
(file-notify-rm-watch key))
file-notify-descriptors))
(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))
(setq frame-title-format
'(""
(:eval
(if (s-contains-p org-roam-directory (or buffer-file-name ""))
(replace-regexp-in-string
".*/[0-9]*-?" ""
(subst-char-in-string ?_ ? buffer-file-name))
"%b"))
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
(load! "+agenda-fix")
(defun vulpea-agenda-files-update (&rest _)
(setq org-agenda-files vulpea-project-files))
(setq org-roam-directory "~/var/org/"
org-roam-dailies-directory "dailies")
(advice-add 'org-agenda :before #'vulpea-agenda-files-update)
(advice-add 'org-todo-list :before #'vulpea-agenda-files-update)
(setq display-line-numbers-type 'normal)
(remove-hook! '(org-mode-hook) #'display-line-numbers-mode)
(setq mm-text-html-renderer 'w3m)
(setq w3m-fill-column 88)
(setq message-kill-buffer-on-exit t)
(setq message-auto-save-directory "~/Mail/colin@unbl.ink/Drafts/")
(setq message-directory "~/Mail/colin@unbl.ink/")
;; sendmail-program "/usr/local/bin/msmtpq" <--- this doesn't work as advertised right now
(setq send-mail-function 'sendmail-send-it
sendmail-program "/usr/local/bin/msmtp"
mail-specify-envelope-from t
message-sendmail-f-is-evil t
message-sendmail-envelope-from 'header
message-sendmail-extra-arguments '("--read-envelope-from")
mail-envelope-from 'header)
(setq notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i")
(:name "unread" :query "tag:inbox and tag:unread" :key "u")
(:name "jira" :query "tag:jira and date:yesterday..today" :key "j")
(:name "github" :query "tag:github and date:yesterday..today" :key "g")))
(after! notmuch
(set-popup-rule! "^\\*notmuch*" :ignore t)
)
(map! :leader
(:prefix "e"
:desc "(s)end queued mail" "s" #'smtpmail-send-queued-mail
:desc "Open (i)nbox" "i" #'=notmuch
:desc "Open (n)otmuch" "n" #'notmuch
:desc "(C)ompose mail" "c" #'notmuch-mua-new-mail))
(after! eshell
(set-eshell-alias!
"djsh" "~/src/github.com/sureapp/surepreme/make shell"
"djpytest" "DJANGO_SETTINGS_MODULE=ff.settings.ci pytest --reuse-db --black --flake8 --isort --durations=3 $*"
"surep" "cd ~/src/github.com/sureapp/surepreme/"
"ffdev" "ssh dev-ff.local "
"f" "(other-window 1) && find-file $1"
"l" "ls -lh"
"d" "dired $1"
"gl" "(call-interactively 'magit-log-current)"
"gs" "magit-status"
"gc" "magit-commit"))
(setq lsp-lens-enable 1
lsp-ui-sideline-enable 1
lsp-enable-links 1
lsp-headerline-breadcrumb-enable 1
lsp-modeline-code-actions-enable 1
lsp-modeline-diagnostics-enable 1
lsp-completion-show-detail 1
lsp-file-watch-threshold nil)