My personal configuration files for Doom emacs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

293 lines
10 KiB

  1. ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
  2. ;; Place your private configuration here! Remember, you do not need to run 'doom
  3. ;; sync' after modifying this file!
  4. ;; Some functionality uses this to identify you, e.g. GPG configuration, email
  5. ;; clients, file templates and snippets.
  6. (setq user-full-name "Levi Olson"
  7. user-mail-address "olson.levi@gmail.com")
  8. ;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
  9. ;; are the three important ones:
  10. ;;
  11. ;; + `doom-font'
  12. ;; + `doom-variable-pitch-font'
  13. ;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
  14. ;; presentations or streaming.
  15. ;;
  16. ;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
  17. ;; font string. You generally only need these two:
  18. ;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
  19. ;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
  20. (setq doom-font (font-spec :family "PragmataPro Liga" :size 20)
  21. doom-variable-pitch-font (font-spec :family "PragmataPro Liga" :size 20) ; inherits `doom-font''s :size
  22. doom-unicode-font (font-spec :family "PragmataPro Liga" :size 12)
  23. doom-big-font (font-spec :family "PragmataPro Liga" :size 30))
  24. (if (eq system-type 'gnu/linux)
  25. (progn
  26. (add-to-list 'default-frame-alist '(top . 400))
  27. (add-to-list 'default-frame-alist '(left . 750))
  28. (add-to-list 'default-frame-alist '(height . 60))
  29. (add-to-list 'default-frame-alist '(width . 235))
  30. ))
  31. ;; There are two ways to load a theme. Both assume the theme is installed and
  32. ;; available. You can either set `doom-theme' or manually load a theme with the
  33. ;; `load-theme' function. This is the default:
  34. ;; (setq doom-theme 'doom-one)
  35. (setq doom-theme 'doom-one)
  36. ;; (delq! t custom-theme-load-path)
  37. ;; If you use `org' and don't want your org files in the default location below,
  38. ;; change `org-directory'. It must be set before org loads!
  39. (setq org-directory "/mnt/c/Users/Levi/Nextcloud/Org")
  40. ;; This determines the style of line numbers in effect. If set to `nil', line
  41. ;; numbers are disabled. For relative line numbers, set this to `relative'.
  42. (setq display-line-numbers-type t)
  43. (setq projectile-project-search-path "~/Projects")
  44. (setq browse-url-chrome-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
  45. (setq browse-url-chromium-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
  46. ;; Here are some additional functions/macros that could help you configure Doom:
  47. ;;
  48. ;; - `load!' for loading external *.el files relative to this one
  49. ;; - `use-package!' for configuring packages
  50. ;; - `after!' for running code after a package has loaded
  51. ;; - `add-load-path!' for adding directories to the `load-path', relative to
  52. ;; this file. Emacs searches the `load-path' when you load packages with
  53. ;; `require' or `use-package'.
  54. ;; - `map!' for binding new keys
  55. ;;
  56. ;; To get information about any of these functions/macros, move the cursor over
  57. ;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
  58. ;; This will open documentation for it, including demos of how they are used.
  59. ;;
  60. ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
  61. ;; they are implemented.
  62. (load! "functions.el")
  63. (use-package! functions)
  64. (load! "fancy-banner.el")
  65. (use-package! fancy-banner)
  66. (load! "setup-elfeed.el")
  67. (use-package! setup-elfeed)
  68. (use-package! prodigy
  69. :config
  70. (prodigy-define-tag
  71. :name 'sass
  72. :ready-message "Sass is watching for changes\\. Press Ctrl\\-C to stop\\.")
  73. (prodigy-define-tag
  74. :name 'mc-server
  75. :ready-message "minecraft is up\\-to\\-date")
  76. (prodigy-define-tag
  77. :name 'mc-reload
  78. :ready-message "Reload complete\\.")
  79. (prodigy-define-service
  80. :name "Sass Compiler"
  81. :command "make"
  82. :args '("sass")
  83. :cwd "~/Projects/chrome/chrome-ext-better-network-panel"
  84. :tags '(sass))
  85. (prodigy-define-service
  86. :name "MC Server"
  87. :command "make"
  88. :args '("start")
  89. :cwd "~/minecraft"
  90. :tags '(mc-server))
  91. (prodigy-define-service
  92. :name "MC Reload"
  93. :command "make"
  94. :args '("rcon" "COMMAND='reload confirm'")
  95. :cwd "~/minecraft"
  96. :tags '(mc-reload))
  97. )
  98. (use-package! darkroom
  99. :custom
  100. (darkroom-margins (cons 40 0))
  101. (darkroom-text-scale-increase 0)
  102. (darkroom-fringes-outside-margins nil)
  103. (darkroom-margin-increment 0.2)
  104. )
  105. (use-package! org
  106. :commands org-capture
  107. :mode ("\\.org\\'" . org-mode)
  108. :bind (
  109. ("C-," . org-cycle-agenda-files)
  110. ("C-c C-d" . org-capture)
  111. :map org-mode-map
  112. ("M-n" . leo/org-narrow-next-tree)
  113. ("M-p" . leo/org-narrow-prev-tree)
  114. ("M-P" . leo/org-present)
  115. )
  116. :preface
  117. (defvar org-html-validation-link)
  118. (defvar org-html-text-markup-alist)
  119. (defvar org-capture-templates)
  120. :init
  121. (setq org-agenda-files (list (concat org-directory "/todo.org")
  122. (concat org-directory "/projects.org")
  123. (concat org-directory "/Recipies.org")
  124. (concat org-directory "/help.org")
  125. (concat org-directory "/personal.org")
  126. (concat org-directory "/archive.org")
  127. ))
  128. (setq org-agenda-include-diary t)
  129. (add-to-list 'safe-local-variable-values '(eval leo/deft-insert-boilerplate))
  130. (setq org-refile-targets '((nil :maxlevel . 3)
  131. (org-agenda-files :maxlevel . 3))
  132. org-default-notes-file (concat org-directory "/todo.org"))
  133. :config
  134. (setq org-capture-templates
  135. '(("t" "new task" entry (file+headline (concat org-directory "/todo.org") "Tasks")
  136. "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n")
  137. ("n" "new note" entry (file+headline org-default-notes-file "Notes")
  138. "* %?\n%i\n")
  139. ("l" "store link" entry (file+olp org-default-notes-file "Links" "Unfiled")
  140. "* %a\n%?\n")
  141. ("d" "store link w/drawer" entry (file+olp org-default-notes-file "Links" "Unfiled")
  142. "* %?\n%l\n:COPIED_TEXT:\n %i\n:END:\n")
  143. ))
  144. (setq org-structure-template-alist
  145. '(("r" . "src restclient :results raw")
  146. ("j" . "src js :cmd \"/usr/local/bin/babel-node\" :results output code")
  147. ("e" . "src emacs-lisp :results silent")
  148. ("a" . "export ascii")
  149. ("c" . "center")
  150. ("C" . "comment")
  151. ("E" . "export")
  152. ("h" . "export html")
  153. ("l" . "export latex")
  154. ("q" . "quote")
  155. ("s" . "src")
  156. ("v" . "verse")))
  157. (defconst checkbox-fontlock-keywords-alist
  158. (mapcar (lambda (regex-char-pair)
  159. `(,(car regex-char-pair)
  160. (0 (prog1 ()
  161. (compose-region (match-beginning 1)
  162. (match-end 1)
  163. ,(concat (list ?\C-i)
  164. (list (decode-char 'ucs (cadr regex-char-pair)))))))))
  165. '(("\\(\\[ \\]\\)" #XF096);2B1C
  166. ("\\(\\[-\\]\\)" #XF147);29C7;F458
  167. ("\\(\\[X\\]\\)" #XF046);2BBD
  168. )))
  169. (defun add-checkbox-symbol-keywords ()
  170. "Add checkbox font to font-lock."
  171. (font-lock-add-keywords nil checkbox-fontlock-keywords-alist))
  172. (add-hook 'org-mode-hook 'add-checkbox-symbol-keywords)
  173. (add-hook 'org-mode-hook '(lambda () (visual-line-mode 0)))
  174. )
  175. (use-package! org-roam
  176. :hook
  177. (org-mode . org-roam-mode)
  178. :config
  179. (setq org-roam-directory (concat org-directory "/Roam/"))
  180. ;; (setq org-roam-directory "/home/leothelocust/Projects/personal/html-to-org/converted/")
  181. (setq org-roam-link-title-format "r::%s")
  182. (org-roam-db-build-cache))
  183. (use-package! deft
  184. :bind
  185. ("C-c n d" . deft)
  186. :config
  187. (setq deft-recursive t
  188. deft-use-filter-string-for-filename t
  189. deft-default-extension "org"
  190. ;; deft-directory "/home/leothelocust/Projects/personal/html-to-org/converted/"
  191. deft-directory (concat org-directory "/Roam/")
  192. deft-recursive-ignore-dir-regexp "\\(?:\\.\\|\\.\\.\\|setup\\)$"))
  193. (use-package! org-journal
  194. :config
  195. (setq org-journal-date-prefix "#+TITLE: "
  196. org-journal-time-prefix "* "
  197. org-journal-date-format "%a, %Y-%m-%d"
  198. org-journal-file-format "%Y-%m-%d.org"
  199. ))
  200. (use-package! org-pandoc-import
  201. :after org
  202. :commands (org-pandoc-import-html-as-org org-pandoc-import-html-to-org)
  203. :config
  204. (org-pandoc-import-backend html)
  205. )
  206. (use-package! lsp-java
  207. :config
  208. (setq lsp-ui-doc-include-signature t
  209. lsp-ui-doc-enable t
  210. lsp-ui-sideline-enable t)
  211. (add-hook 'java-mode-hook #'lsp-deferred)
  212. (add-hook 'java-mode-hook #'lsp-lens-mode)
  213. ;; (add-hook 'java-mode-hook #'lsp-java-boot-lens-mode)
  214. (add-hook 'java-mode-hook #'lsp-ui-mode))
  215. (use-package! apex-mode
  216. :mode "\\.cls\\'"
  217. :bind ("M-q" . #'leo/kill-this-buffer-unless-scratch)
  218. :config
  219. (lsp-)
  220. )
  221. (add-hook 'css-mode-hook #'lsp-deferred)
  222. (add-hook 'js-mode-hook #'lsp-deferred)
  223. (map! :map global-map
  224. :prefix "C-x"
  225. "C-l" nil
  226. (:prefix ("C-l" . "launch")
  227. "a" #'org-agenda
  228. "e" #'elfeed
  229. "g" #'magit-status)
  230. )
  231. (map! :map global-map
  232. "M-t" #'treemacs-select-window
  233. "M-q" #'leo/kill-this-buffer-unless-scratch
  234. "M-RET" #'lsp-ui-doc-glance
  235. "C-<tab>" #'leo/tidy
  236. "C-;" #'leo/comment-or-uncomment-region-or-line
  237. "C-c C-e" #'leo/edit-config
  238. "C-c d" #'leo/duplicate-thing
  239. "M-n" #'leo/jump-to-next-symbol
  240. "M-p" #'leo/jump-to-prev-symbol
  241. "M-u" #'upcase-dwim
  242. "M-c" #'capitalize-dwim
  243. "M-l" #'downcase-dwim
  244. "C-c b" #'counsel-switch-buffer
  245. "C-s" #'swiper
  246. "C-}" #'mc/mark-next-like-this
  247. "C-)" #'mc/unmark-next-like-this
  248. "C-{" #'mc/mark-previous-like-this
  249. "C-(" #'mc/unmark-previous-like-this
  250. "C-@" #'er/expand-region
  251. "C-#" #'er/contract-region
  252. "C-c C-r" #'counsel-recoll
  253. )