packages.el 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. ;;; packages.el --- chicken-dotfiles layer packages file for Spacemacs.
  2. ;;
  3. ;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
  4. ;;
  5. ;; Author: Eiyeron <eiyeron@Ducktop>
  6. ;; URL: https://github.com/syl20bnr/spacemacs
  7. ;;
  8. ;; This file is not part of GNU Emacs.
  9. ;;
  10. ;;; License: GPLv3
  11. ;;; Commentary:
  12. ;; See the Spacemacs documentation and FAQs for instructions on how to implement
  13. ;; a new layer:
  14. ;;
  15. ;; SPC h SPC layers RET
  16. ;;
  17. ;;
  18. ;; Briefly, each package to be installed or configured by this layer should be
  19. ;; added to `chicken-dotfiles-packages'. Then, for each package PACKAGE:
  20. ;;
  21. ;; - If PACKAGE is not referenced by any other Spacemacs layer, define a
  22. ;; function `chicken-dotfiles/init-PACKAGE' to load and initialize the package.
  23. ;; - Otherwise, PACKAGE is already referenced by another Spacemacs layer, so
  24. ;; define the functions `chicken-dotfiles/pre-init-PACKAGE' and/or
  25. ;; `chicken-dotfiles/post-init-PACKAGE' to customize the package as it is loaded.
  26. ;;; Code:
  27. (defconst chicken-dotfiles-packages
  28. '(
  29. org
  30. org-agenda
  31. org-bullets
  32. org-brain
  33. all-the-icons
  34. modern-cpp-font-lock
  35. )
  36. "The list of Lisp packages required by the chicken-dotfiles layer.
  37. Each entry is either:
  38. 1. A symbol, which is interpreted as a package to be installed, or
  39. 2. A list of the form (PACKAGE KEYS...), where PACKAGE is the
  40. name of the package to be installed or loaded, and KEYS are
  41. any number of keyword-value-pairs.
  42. The following keys are accepted:
  43. - :excluded (t or nil): Prevent the package from being loaded
  44. if value is non-nil
  45. - :location: Specify a custom installation location.
  46. The following values are legal:
  47. - The symbol `elpa' (default) means PACKAGE will be
  48. installed using the Emacs package manager.
  49. - The symbol `local' directs Spacemacs to load the file at
  50. `./local/PACKAGE/PACKAGE.el'
  51. - A list beginning with the symbol `recipe' is a melpa
  52. recipe. See: https://github.com/milkypostman/melpa#recipe-format"
  53. )
  54. (defun chicken-dotfiles/init-org-brain()
  55. (use-package org-brain
  56. :defer t
  57. :init
  58. (setq org-brain-path "D:/Notes/Brain")
  59. :config
  60. (setq org-id-locations-file "~/.emacs.d/.org-id-locations")
  61. (evil-set-initial-state 'org-brain-visualize-mode 'emacs)
  62. ;; See https://github.com/Kungsgeten/org-brain#all-the-icons
  63. (defun org-brain-insert-resource-icon (link)
  64. "Insert an icon, based on content of org-mode LINK."
  65. (insert (format "%s "
  66. (cond
  67. ;; File extensions
  68. ((string-suffix-p ".pdf" link)
  69. (all-the-icons-octicon "file-pdf"))
  70. ((string-match ".cpp" link)
  71. (all-the-icons-alltheicon "cplusplus"))
  72. ((string-match ".h" link)
  73. (all-the-icons-alltheicon "cplusplus-line"))
  74. ((string-match ".hpp" link)
  75. (all-the-icons-alltheicon "cplusplus-line"))
  76. ;; URL
  77. ((string-prefix-p "http" link)
  78. (cond ((string-match "wikipedia\\.org" link)
  79. (all-the-icons-faicon "wikipedia-w"))
  80. ((string-match "github\\.com" link)
  81. (all-the-icons-octicon "mark-github"))
  82. ((string-match "vimeo\\.com" link)
  83. (all-the-icons-faicon "vimeo"))
  84. ((string-match "youtube\\.com" link)
  85. (all-the-icons-faicon "youtube"))
  86. ((string-match "bitbucket\\.org" link)
  87. (all-the-icons-faicon "bitbucket"))
  88. ((string-match "stackoverflow\\.com" link)
  89. (all-the-icons-faicon "stack-overflow"))
  90. (t
  91. (all-the-icons-faicon "globe"))))
  92. ((string-prefix-p "brain:" link)
  93. (all-the-icons-fileicon "brain"))
  94. (t
  95. (all-the-icons-icon-for-file link))))))
  96. (add-hook 'org-brain-after-resource-button-functions #'org-brain-insert-resource-icon)
  97. ))
  98. (defun chicken-dotfiles/init-modern-cpp-font-lock()
  99. (add-hook 'c++-mode-hook #'modern-c++-font-lock-mode))
  100. (defun chicken-dotfiles/post-init-org-bullets()
  101. (use-package org-bullets
  102. :defer t
  103. :init
  104. (setq org-bullets-bullet-list '("◼"))
  105. )
  106. )
  107. (defun chicken-dotfiles/post-init-org-agenda()
  108. (use-package org-agenda
  109. :defer t
  110. :init
  111. (setq org-agenda-to-appt t)
  112. (setq org-agenda-include-diary t)
  113. (setq org-agenda-files (list
  114. "C:/Notes/Agenda/birthdays.org"
  115. ;; GTD
  116. "C:/Notes/inbox.org" "c:/Notes/inbox_work.org" "C:/Notes/gtd.org" "C:/Notes/gtd_work.org" "C:/Notes/tickler_work.org"))
  117. ))
  118. (defun chicken-dotfiles/post-init-org()
  119. (use-package org
  120. :defer t
  121. :init
  122. (setq org-cycle-level-faces nil)
  123. (setq org-modules
  124. '(org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-mouse org-rmail org-w3m org-drill))
  125. (setq org-todo-keywords '((sequence "TODO" "WAITING" "IN PROGRESS" "|" "DONE" "CANCELLED")))
  126. ; GTD inspired by https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
  127. (setq org-capture-templates '(("t" "Todo [inbox]" entry
  128. (file+headline "C:/Notes/inbox.org" "Tasks")
  129. "* TODO %i%?")
  130. ("T" "Todo [tickler]" entry
  131. (file+headline "C:/Notes/tickler.org" "Tasks")
  132. "* %i%? \n %U")
  133. ;; Media
  134. ("A" "Artist" entry
  135. (file+headline "C:/Notes/inbox.org" "Music")
  136. "* TODO %i%? \n %U")
  137. ("S" "Series" entry
  138. (file+headline "C:/Notes/inbox.org" "Series")
  139. "* TODO %i%? \n %U")
  140. ;; Work
  141. ("W" "Work [inbox]" entry
  142. (file+headline "C:/Notes/inbox_work.org" "Tasks")
  143. "* TODO %i%?")
  144. ))
  145. (setq org-directory "C:/Notes")
  146. (setq org-default-notes-file "C:/Notes/inbox.org" )
  147. (setq org-refile-targets '(("C:/Notes/gtd.org" :maxlevel . 3)
  148. ("C:/Notes/gtd_work.org" :maxlevel . 3)
  149. ("C:/Notes/backlog.org" :level . 2)
  150. ))
  151. (defun wild-git-url(path)
  152. (shell-command (concat "start " (concat "https://github.com/WildSheepStudio/Wild/commit/" path))))
  153. ;; TODO Replace with org-link-abbrev-alist or attempt to make a completion routine as seen here : https://orgmode.org/manual/Completion.html#Completion
  154. :config
  155. (org-link-set-parameters "wild-git" :follow 'wild-git-url)
  156. (set-face-attribute 'org-table nil :family "Iosevka")
  157. (set-face-attribute 'org-block nil :family "Iosevka")
  158. (set-face-attribute 'org-code nil :family "Iosevka" :weight 'light :height 0.8)
  159. (set-face-attribute 'org-default nil :family "ETBembo")
  160. ;; TODO Use Spacemacs' utilities instead?
  161. (add-hook 'org-mode-hook 'buffer-face-mode)
  162. (setq org-bullets-bullet-list '(" "))
  163. )
  164. )
  165. ;;; packages.el ends here