config.el 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
  2. (setq user-full-name "Colin Powell"
  3. user-mail-address "colin@unbl.ink")
  4. (nyan-mode)
  5. (setq doom-theme 'doom-one
  6. doom-font (font-spec :family "Iosevka" :size 14 :weight 'regular)
  7. doom-big-font (font-spec :family "Iosevka" :size 18 :weight 'regular)
  8. doom-variable-pitch-font (font-spec :family "Overpass" :size 12))
  9. (setq display-line-numbers-type t)
  10. ;; change `org-directory'. It must be set before org loads!
  11. (setq org-directory "~/var/org/")
  12. (load! "+agenda-fix")
  13. (defun vulpea-agenda-files-update (&rest _)
  14. (setq org-agenda-files vulpea-project-files))
  15. (setq org-roam-directory "~/var/org/"
  16. org-roam-dailies-directory "dailies")
  17. (advice-add 'org-agenda :before #'vulpea-agenda-files-update)
  18. (advice-add 'org-todo-list :before #'vulpea-agenda-files-update)
  19. (map! ;; Easier window movement
  20. :n "C-h" 'evil-window-left
  21. :n "C-j" 'evil-window-down
  22. :n "C-k" 'evil-window-up
  23. :n "C-l" 'evil-window-right
  24. (:map evil-treemacs-state-map
  25. "C-h" 'evil-window-left
  26. "C-l" 'evil-window-right)
  27. :leader
  28. (:prefix "f"
  29. :desc "Find file in dotfiles" "t" #'+hlissner/find-in-dotfiles
  30. :desc "Browse dotfiles" "T" #'+hlissner/browse-dotfiles)
  31. (:prefix "b"
  32. :desc "Black format buffer" "f" #'blacken-buffer
  33. :desc "isort buffer" "I" #'py-isort-buffer
  34. :desc "Links in buffer" "l" #'ace-link-org))
  35. (defun unfill-paragraph ()
  36. "Takes a multi-line paragraph and makes it into a single line of text."
  37. (interactive)
  38. (let ((fill-column (point-max)))
  39. (fill-paragraph nil)))
  40. (define-key global-map "\M-z" 'unfill-paragraph)
  41. (defun file-notify-rm-all-watches ()
  42. "Remove all existing file notification watches from Emacs."
  43. (interactive)
  44. (maphash
  45. (lambda (key _value)
  46. (file-notify-rm-watch key))
  47. file-notify-descriptors))
  48. (setq frame-title-format
  49. '(""
  50. (:eval
  51. (if (s-contains-p org-roam-directory (or buffer-file-name ""))
  52. (replace-regexp-in-string
  53. ".*/[0-9]*-?" "☰ "
  54. (subst-char-in-string ?_ ? buffer-file-name))
  55. "%b"))
  56. (:eval
  57. (let ((project-name (projectile-project-name)))
  58. (unless (string= "-" project-name)
  59. (format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
  60. (setq mm-text-html-renderer 'w3m)
  61. (setq w3m-fill-column 88)
  62. (setq lsp-lens-enable 1
  63. lsp-ui-sideline-enable 1
  64. lsp-enable-links 1
  65. lsp-headerline-breadcrumb-enable 1
  66. lsp-modeline-code-actions-enable 1
  67. lsp-modeline-diagnostics-enable 1
  68. lsp-completion-show-detail 1
  69. lsp-file-watch-threshold nil)
  70. ;; check for hosts folder and find any init-HOSTNAME.el files in there and load them
  71. (defvar host (substring (shell-command-to-string "hostname") 0 -1))
  72. (defvar host-dir "~/.config/doom/hosts/")
  73. (add-load-path! host-dir)
  74. ;;(let ((init-host-feature (intern (concat "init-" host ".el"))))
  75. ;; (load-file init-host-feature))
  76. (defvar host-init (concat "~/.config/doom/hosts/init-" host ".el"))
  77. (if (file-exists-p host-init)
  78. (load-file host-init))
  79. (load-file "~/.config/doom/+agenda-fix.el")