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.

217 lines
8.0 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. ;; Here are some additional functions/macros that could help you configure Doom:
  44. ;;
  45. ;; - `load!' for loading external *.el files relative to this one
  46. ;; - `use-package!' for configuring packages
  47. ;; - `after!' for running code after a package has loaded
  48. ;; - `add-load-path!' for adding directories to the `load-path', relative to
  49. ;; this file. Emacs searches the `load-path' when you load packages with
  50. ;; `require' or `use-package'.
  51. ;; - `map!' for binding new keys
  52. ;;
  53. ;; To get information about any of these functions/macros, move the cursor over
  54. ;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
  55. ;; This will open documentation for it, including demos of how they are used.
  56. ;;
  57. ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
  58. ;; they are implemented.
  59. (load! "functions.el")
  60. (use-package! functions)
  61. (load! "fancy-banner.el")
  62. (use-package! fancy-banner)
  63. (load! "setup-elfeed.el")
  64. (use-package! setup-elfeed)
  65. (map! :map global-map
  66. :prefix "C-x"
  67. "C-l" nil
  68. (:prefix ("C-l" . "launch")
  69. "a" #'org-agenda
  70. "e" #'elfeed))
  71. (use-package! org
  72. :commands org-capture
  73. :mode ("\\.org\\'" . org-mode)
  74. :bind (
  75. ("C-," . org-cycle-agenda-files)
  76. ("C-c C-d" . org-capture)
  77. :map org-mode-map
  78. ("M-n" . leo/org-narrow-next-tree)
  79. ("M-p" . leo/org-narrow-prev-tree)
  80. ("M-P" . leo/org-present)
  81. )
  82. :preface
  83. (defvar org-html-validation-link)
  84. (defvar org-html-text-markup-alist)
  85. (defvar org-capture-templates)
  86. :init
  87. (setq org-agenda-files '("/mnt/c/Users/Levi/Nextcloud/Org/todo.org"
  88. "/mnt/c/Users/Levi/Nextcloud/Org/projects.org"
  89. "/mnt/c/Users/Levi/Nextcloud/Org/Recipies.org"
  90. "/mnt/c/Users/Levi/Nextcloud/Org/help.org"
  91. "/mnt/c/Users/Levi/Nextcloud/Org/personal.org"
  92. "/mnt/c/Users/Levi/Nextcloud/Org/archive.org"
  93. ))
  94. (setq org-agenda-include-diary t)
  95. (add-to-list 'safe-local-variable-values '(eval leo/deft-insert-boilerplate))
  96. (setq org-refile-targets '((nil :maxlevel . 3)
  97. (org-agenda-files :maxlevel . 3))
  98. org-directory "/mnt/c/Users/Levi/Nextcloud/Org"
  99. org-default-notes-file (concat org-directory "/todo.org"))
  100. :config
  101. (setq org-capture-templates
  102. '(("t" "new task" entry (file+headline "/mnt/c/Users/Levi/Nextcloud/Org/todo.org" "Tasks")
  103. "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n")
  104. ("n" "new note" entry (file+headline org-default-notes-file "Notes")
  105. "* %?\n%i\n")
  106. ("l" "store link" entry (file+olp org-default-notes-file "Links" "Unfiled")
  107. "* %a\n%?\n")
  108. ("d" "store link w/drawer" entry (file+olp org-default-notes-file "Links" "Unfiled")
  109. "* %?\n%l\n:COPIED_TEXT:\n %i\n:END:\n")
  110. ))
  111. (setq org-structure-template-alist
  112. '(("r" . "src restclient :results raw")
  113. ("j" . "src js :cmd \"/usr/local/bin/babel-node\" :results output code")
  114. ("e" . "src emacs-lisp :results silent")
  115. ("a" . "export ascii")
  116. ("c" . "center")
  117. ("C" . "comment")
  118. ("E" . "export")
  119. ("h" . "export html")
  120. ("l" . "export latex")
  121. ("q" . "quote")
  122. ("s" . "src")
  123. ("v" . "verse")))
  124. (defconst checkbox-fontlock-keywords-alist
  125. (mapcar (lambda (regex-char-pair)
  126. `(,(car regex-char-pair)
  127. (0 (prog1 ()
  128. (compose-region (match-beginning 1)
  129. (match-end 1)
  130. ,(concat (list ?\C-i)
  131. (list (decode-char 'ucs (cadr regex-char-pair)))))))))
  132. '(("\\(\\[ \\]\\)" #XF096);2B1C
  133. ("\\(\\[-\\]\\)" #XF147);29C7;F458
  134. ("\\(\\[X\\]\\)" #XF046);2BBD
  135. )))
  136. (defun add-checkbox-symbol-keywords ()
  137. "Add checkbox font to font-lock."
  138. (font-lock-add-keywords nil checkbox-fontlock-keywords-alist))
  139. (add-hook 'org-mode-hook 'add-checkbox-symbol-keywords)
  140. )
  141. (use-package! org-roam
  142. :hook
  143. (org-mode . org-roam-mode)
  144. :config
  145. (org-roam-db-build-cache)
  146. (setq org-roam-directory "/mnt/c/Users/Levi/Nextcloud/Org/Roam/")
  147. (setq org-roam-link-title-format "r::%s"))
  148. (use-package! deft
  149. :bind
  150. ("C-c n d" . deft)
  151. :custom
  152. (deft-recursive t)
  153. (deft-use-filter-string-for-filename t)
  154. (deft-default-extension "org")
  155. (deft-directory "/mnt/c/Users/Levi/Nextcloud/Org/Roam/"))
  156. (use-package! lsp-java
  157. :config
  158. (setq lsp-ui-doc-include-signature t
  159. lsp-ui-doc-enable t
  160. lsp-ui-sideline-enable t)
  161. (add-hook 'java-mode-hook #'lsp-deferred)
  162. (add-hook 'java-mode-hook #'lsp-lens-mode)
  163. ;; (add-hook 'java-mode-hook #'lsp-java-boot-lens-mode)
  164. (add-hook 'java-mode-hook #'lsp-ui-mode))
  165. (add-hook 'css-mode-hook #'lsp-deferred)
  166. (add-hook 'js-mode-hook #'lsp-deferred)
  167. (map! :map global-map
  168. "M-t" #'treemacs-select-window
  169. "M-q" #'leo/kill-this-buffer-unless-scratch
  170. "M-RET" #'lsp-ui-doc-glance
  171. "C-<tab>" #'leo/tidy
  172. "C-;" #'leo/comment-or-uncomment-region-or-line
  173. "C-c C-e" #'leo/edit-config
  174. "C-c d" #'leo/duplicate-thing
  175. "M-n" #'leo/jump-to-next-symbol
  176. "M-p" #'leo/jump-to-prev-symbol
  177. "M-u" #'upcase-dwim
  178. "M-c" #'capitalize-dwim
  179. "M-l" #'downcase-dwim
  180. "C-c b" #'ivy-switch-buffer
  181. "C-s" #'swiper
  182. "C-}" #'mc/mark-next-like-this
  183. "C-)" #'mc/unmark-next-like-this
  184. "C-{" #'mc/mark-previous-like-this
  185. "C-(" #'mc/unmark-previous-like-this
  186. "C-@" #'er/expand-region
  187. "C-#" #'er/contract-region
  188. )