packages.el 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. )
  35. "The list of Lisp packages required by the chicken-dotfiles layer.
  36. Each entry is either:
  37. 1. A symbol, which is interpreted as a package to be installed, or
  38. 2. A list of the form (PACKAGE KEYS...), where PACKAGE is the
  39. name of the package to be installed or loaded, and KEYS are
  40. any number of keyword-value-pairs.
  41. The following keys are accepted:
  42. - :excluded (t or nil): Prevent the package from being loaded
  43. if value is non-nil
  44. - :location: Specify a custom installation location.
  45. The following values are legal:
  46. - The symbol `elpa' (default) means PACKAGE will be
  47. installed using the Emacs package manager.
  48. - The symbol `local' directs Spacemacs to load the file at
  49. `./local/PACKAGE/PACKAGE.el'
  50. - A list beginning with the symbol `recipe' is a melpa
  51. recipe. See: https://github.com/milkypostman/melpa#recipe-format"
  52. )
  53. (defun chicken-dotfiles/init-org-brain()
  54. (use-package org-brain
  55. :defer t
  56. :init
  57. (setq org-brain-path "D:/Notes/Brain")
  58. :config
  59. (setq org-id-locations-file "~/.emacs.d/.org-id-locations")
  60. (evil-set-initial-state 'org-brain-visualize-mode 'emacs)
  61. ;; See https://github.com/Kungsgeten/org-brain#all-the-icons
  62. (defun org-brain-insert-resource-icon (link)
  63. "Insert an icon, based on content of org-mode LINK."
  64. (insert (format "%s "
  65. (cond ((string-prefix-p "http" link)
  66. (cond ((string-match "wikipedia\\.org" link)
  67. (all-the-icons-faicon "wikipedia-w"))
  68. ((string-match "github\\.com" link)
  69. (all-the-icons-octicon "mark-github"))
  70. ((string-match "vimeo\\.com" link)
  71. (all-the-icons-faicon "vimeo"))
  72. ((string-match "youtube\\.com" link)
  73. (all-the-icons-faicon "youtube"))
  74. ((string-match "bitbucket\\.org" link)
  75. (all-the-icons-faicon "bitbucket"))
  76. ((string-match "stackoverflow\\.com" link)
  77. (all-the-icons-faicon "stack-overflow"))
  78. ((string-match "\\.pdf$" link)
  79. (all-the-icons-octicon "file-pdf"))
  80. (t
  81. (all-the-icons-faicon "globe"))))
  82. ((string-prefix-p "brain:" link)
  83. (all-the-icons-fileicon "brain"))
  84. (t
  85. (all-the-icons-icon-for-file link))))))
  86. (add-hook 'org-brain-after-resource-button-functions #'org-brain-insert-resource-icon)
  87. ))
  88. (defun chicken-dotfiles/post-init-org-bullets()
  89. (use-package org-bullets
  90. :defer t
  91. :init
  92. (setq org-bullets-bullet-list '("◉" "○" "⬡" "⬢" "■" "□" "◈" "◇"))
  93. )
  94. )
  95. (defun chicken-dotfiles/post-init-org-agenda()
  96. (use-package org-agenda
  97. :defer t
  98. :init
  99. (setq org-agenda-to-appt t)
  100. (setq org-agenda-include-diary t)
  101. (setq org-agenda-files (list
  102. "~/Notes/Agenda/birthdays.org"
  103. ;; GTD
  104. "~/Notes/inbox.org" "~/Notes/gtd.org" "~/Notes/tickler.org"))
  105. )
  106. )
  107. (defun chicken-dotfiles/post-init-org()
  108. (use-package org
  109. :defer t
  110. :init
  111. (setq org-cycle-level-faces nil)
  112. (setq org-modules
  113. '(org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-mouse org-rmail org-w3m org-drill))
  114. (setq org-todo-keywords '((sequence "TODO" "WAITING" "IN PROGRESS" "|" "DONE" "CANCELLED")))
  115. ; GTD inspired by https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
  116. (setq org-capture-templates '(("t" "Todo [inbox]" entry
  117. (file+headline "~/Notes/inbox.org" "Tasks")
  118. "* TODO %i%?")
  119. ("T" "Tickler" entry
  120. (file+headline "~/Notes/tickler.org" "Tickler")
  121. "* %i%? \n %U")
  122. ;; Media
  123. ("A" "Artist" entry
  124. (file+headline "~/Notes/inbox.org" "Music")
  125. "* TODO %i%? \n %U")
  126. ("S" "Series" entry
  127. (file+headline "~/Notes/inbox.org" "Series")
  128. "* TODO %i%? \n %U"))
  129. )
  130. (setq org-directory "~/Notes")
  131. (setq org-default-notes-file "~/Notes/inbox.org" )
  132. (setq org-refile-targets '(("~/Notes/gtd.org" :maxlevel . 3)
  133. ("~/Notes/backlog.org" :level . 2)
  134. ("~/Notes/tickler.org" :maxlevel . 2)))
  135. )
  136. )
  137. ;;; packages.el ends here