config.el 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
  2. (setq user-full-name "Colin Powell"
  3. user-mail-address "colin@unbl.ink")
  4. (add-to-list 'load-path "~/.config/doom/")
  5. (pixel-scroll-precision-mode t)
  6. (nyan-mode) ;; progress in the form of a rainbow cat.
  7. (setq doom-theme 'doom-one
  8. doom-font (font-spec :family "Iosevka" :size 14 :weight 'regular)
  9. doom-big-font (font-spec :family "Iosevka" :size 18 :weight 'regular)
  10. doom-variable-pitch-font (font-spec :family "Overpass" :size 12))
  11. (add-hook 'after-init-hook #'global-emojify-mode) ;; emojis?!
  12. (add-hook 'prog-mode-hook #'goto-address-mode) ;; linify links!
  13. (map! ;; Easier window movement
  14. :n "C-h" 'evil-window-left
  15. :n "C-j" 'evil-window-down
  16. :n "C-k" 'evil-window-up
  17. :n "C-l" 'evil-window-right
  18. (:map evil-treemacs-state-map
  19. "C-h" 'evil-window-left
  20. "C-l" 'evil-window-right))
  21. (defun unfill-paragraph ()
  22. "Takes a multi-line paragraph and makes it into a single line of text."
  23. (interactive)
  24. (let ((fill-column (point-max)))
  25. (fill-paragraph nil)))
  26. (define-key global-map "\M-z" 'unfill-paragraph)
  27. (defun file-notify-rm-all-watches ()
  28. "Remove all existing file notification watches from Emacs."
  29. (interactive)
  30. (maphash
  31. (lambda (key _value)
  32. (file-notify-rm-watch key))
  33. file-notify-descriptors))
  34. (setq +format-on-save-enabled-modes
  35. '(not
  36. emacs-lisp-mode ; elisp's mechanisms are good enough
  37. sql-mode ; sqlformat is currently broken
  38. tex-mode ; latexindent is broken
  39. org-mode
  40. html-mode
  41. latex-mode))
  42. (setq frame-title-format
  43. '(""
  44. (:eval
  45. (if (s-contains-p org-roam-directory (or buffer-file-name ""))
  46. (replace-regexp-in-string
  47. ".*/[0-9]*-?" "☰ "
  48. (subst-char-in-string ?_ ? buffer-file-name))
  49. "%b"))
  50. (:eval
  51. (let ((project-name (projectile-project-name)))
  52. (unless (string= "-" project-name)
  53. (format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
  54. (load! "+agenda-fix")
  55. (defun vulpea-agenda-files-update (&rest _)
  56. (setq org-agenda-files vulpea-project-files))
  57. (setq org-roam-directory "~/var/org/"
  58. org-roam-dailies-directory "dailies")
  59. (advice-add 'org-agenda :before #'vulpea-agenda-files-update)
  60. (advice-add 'org-todo-list :before #'vulpea-agenda-files-update)
  61. (setq display-line-numbers-type 'normal)
  62. (remove-hook! '(org-mode-hook) #'display-line-numbers-mode)
  63. (setq mm-text-html-renderer 'w3m)
  64. (setq w3m-fill-column 88)
  65. (setq message-kill-buffer-on-exit t)
  66. (setq message-auto-save-directory "~/Mail/colin@unbl.ink/Drafts/")
  67. (setq message-directory "~/Mail/colin@unbl.ink/")
  68. ;; sendmail-program "/usr/local/bin/msmtpq" <--- this doesn't work as advertised right now
  69. (setq send-mail-function 'sendmail-send-it
  70. sendmail-program "/usr/local/bin/msmtp"
  71. mail-specify-envelope-from t
  72. message-sendmail-f-is-evil t
  73. message-sendmail-envelope-from 'header
  74. message-sendmail-extra-arguments '("--read-envelope-from")
  75. mail-envelope-from 'header)
  76. (setq notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i")
  77. (:name "unread" :query "tag:inbox and tag:unread" :key "u")
  78. (:name "jira" :query "tag:jira and date:yesterday..today" :key "j")
  79. (:name "github" :query "tag:github and date:yesterday..today" :key "g")))
  80. (after! notmuch
  81. (set-popup-rule! "^\\*notmuch*" :ignore t)
  82. )
  83. (map! :leader
  84. (:prefix "e"
  85. :desc "(s)end queued mail" "s" #'smtpmail-send-queued-mail
  86. :desc "Open (i)nbox" "i" #'=notmuch
  87. :desc "Open (n)otmuch" "n" #'notmuch
  88. :desc "(C)ompose mail" "c" #'notmuch-mua-new-mail))
  89. (after! eshell
  90. (set-eshell-alias!
  91. "djsh" "~/src/github.com/sureapp/surepreme/make shell"
  92. "djpytest" "DJANGO_SETTINGS_MODULE=ff.settings.ci pytest --reuse-db --black --flake8 --isort --durations=3 $*"
  93. "surep" "cd ~/src/github.com/sureapp/surepreme/"
  94. "ffdev" "ssh dev-ff.local "
  95. "f" "(other-window 1) && find-file $1"
  96. "l" "ls -lh"
  97. "d" "dired $1"
  98. "gl" "(call-interactively 'magit-log-current)"
  99. "gs" "magit-status"
  100. "gc" "magit-commit"))
  101. (setq lsp-lens-enable 1
  102. lsp-ui-sideline-enable 1
  103. lsp-enable-links 1
  104. lsp-headerline-breadcrumb-enable 1
  105. lsp-modeline-code-actions-enable 1
  106. lsp-modeline-diagnostics-enable 1
  107. lsp-completion-show-detail 1
  108. lsp-file-watch-threshold nil)