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.

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