소스 검색

More file type support for Org-Brain

floriandormont 6 년 전
부모
커밋
cfee519118
1개의 변경된 파일55개의 추가작업 그리고 26개의 파일을 삭제
  1. 55 26
      packages.el

+ 55 - 26
packages.el

@@ -36,6 +36,7 @@
     org-bullets
     org-brain
     all-the-icons
+    modern-cpp-font-lock
     )
   "The list of Lisp packages required by the chicken-dotfiles layer.
 
@@ -78,7 +79,18 @@ recipe.  See: https://github.com/milkypostman/melpa#recipe-format"
     (defun org-brain-insert-resource-icon (link)
       "Insert an icon, based on content of org-mode LINK."
       (insert (format "%s "
-                      (cond ((string-prefix-p "http" link)
+                      (cond
+                       ;; File extensions
+                       ((string-suffix-p ".pdf" link)
+                        (all-the-icons-octicon "file-pdf"))
+                       ((string-match ".cpp" link)
+                        (all-the-icons-alltheicon "cplusplus"))
+                       ((string-match ".h" link)
+                        (all-the-icons-alltheicon "cplusplus-line"))
+                       ((string-match ".hpp" link)
+                        (all-the-icons-alltheicon "cplusplus-line"))
+                       ;; URL
+                       ((string-prefix-p "http" link)
                              (cond ((string-match "wikipedia\\.org" link)
                                     (all-the-icons-faicon "wikipedia-w"))
                                    ((string-match "github\\.com" link)
@@ -91,23 +103,24 @@ recipe.  See: https://github.com/milkypostman/melpa#recipe-format"
                                     (all-the-icons-faicon "bitbucket"))
                                    ((string-match "stackoverflow\\.com" link)
                                     (all-the-icons-faicon "stack-overflow"))
-                                   ((string-match "\\.pdf$" link)
-                                    (all-the-icons-octicon "file-pdf"))
                                    (t
                                     (all-the-icons-faicon "globe"))))
-                            ((string-prefix-p "brain:" link)
-                             (all-the-icons-fileicon "brain"))
-                            (t
-                             (all-the-icons-icon-for-file link))))))
+                       ((string-prefix-p "brain:" link)
+                        (all-the-icons-fileicon "brain"))
+                       (t
+                        (all-the-icons-icon-for-file link)))))) 
 
     (add-hook 'org-brain-after-resource-button-functions #'org-brain-insert-resource-icon)
     ))
 
+(defun chicken-dotfiles/init-modern-cpp-font-lock()
+  (add-hook 'c++-mode-hook #'modern-c++-font-lock-mode))
+
 (defun chicken-dotfiles/post-init-org-bullets()
   (use-package org-bullets
     :defer t
     :init
-    (setq org-bullets-bullet-list '("◉" "○" "⬡" "⬢" "■" "□" "◈" "◇"))
+    (setq org-bullets-bullet-list '(""))
     )
   )
 
@@ -118,11 +131,10 @@ recipe.  See: https://github.com/milkypostman/melpa#recipe-format"
     (setq org-agenda-to-appt t)
     (setq org-agenda-include-diary t)
     (setq org-agenda-files (list
-                            "~/Notes/Agenda/birthdays.org"
+                            "C:/Notes/Agenda/birthdays.org"
                             ;; GTD
-                            "~/Notes/inbox.org" "~/Notes/gtd.org" "~/Notes/tickler.org"))
-    )
-  )
+                            "C:/Notes/inbox.org" "c:/Notes/inbox_work.org" "C:/Notes/gtd.org" "C:/Notes/gtd_work.org" "C:/Notes/tickler_work.org"))
+    ))
 
 (defun chicken-dotfiles/post-init-org()
   (use-package org
@@ -135,26 +147,43 @@ recipe.  See: https://github.com/milkypostman/melpa#recipe-format"
                                         ; GTD inspired by https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
 
     (setq org-capture-templates '(("t" "Todo [inbox]" entry
-                                   (file+headline "~/Notes/inbox.org" "Tasks")
+                                   (file+headline "C:/Notes/inbox.org" "Tasks")
                                    "* TODO %i%?")
-                                  ("T" "Tickler" entry
-                                   (file+headline "~/Notes/tickler.org" "Tickler")
+                                  ("T" "Todo [tickler]" entry
+                                   (file+headline "C:/Notes/tickler.org" "Tasks")
                                    "* %i%? \n %U")
                                   ;; Media
                                   ("A" "Artist" entry
-                                  (file+headline "~/Notes/inbox.org" "Music")
+                                  (file+headline "C:/Notes/inbox.org" "Music")
                                   "* TODO %i%? \n %U")
                                   ("S" "Series" entry
-                                  (file+headline "~/Notes/inbox.org" "Series")
-                                  "* TODO %i%? \n %U"))
-          )
-
-   
-    (setq org-directory "~/Notes")
-    (setq org-default-notes-file "~/Notes/inbox.org" )
-    (setq org-refile-targets '(("~/Notes/gtd.org" :maxlevel . 3)
-                               ("~/Notes/backlog.org" :level . 2)
-                               ("~/Notes/tickler.org" :maxlevel . 2)))
+                                  (file+headline "C:/Notes/inbox.org" "Series")
+                                  "* TODO %i%? \n %U")
+                                  ;; Work
+                                  ("W" "Work [inbox]" entry
+                                   (file+headline "C:/Notes/inbox_work.org" "Tasks")
+                                   "* TODO %i%?")
+                                  ))
+
+    (setq org-directory "C:/Notes")
+    (setq org-default-notes-file "C:/Notes/inbox.org" )
+    (setq org-refile-targets '(("C:/Notes/gtd.org" :maxlevel . 3)
+                               ("C:/Notes/gtd_work.org" :maxlevel . 3)
+                               ("C:/Notes/backlog.org" :level . 2)
+                               ))
+    (defun wild-git-url(path)
+      (shell-command (concat "start " (concat "https://github.com/WildSheepStudio/Wild/commit/" path))))
+
+    ;; TODO Replace with org-link-abbrev-alist or attempt to make a completion routine as seen here : https://orgmode.org/manual/Completion.html#Completion
+    :config
+    (org-link-set-parameters "wild-git" :follow 'wild-git-url)
+    (set-face-attribute 'org-table nil :family "Iosevka")
+    (set-face-attribute 'org-block nil :family "Iosevka")
+    (set-face-attribute 'org-code nil :family "Iosevka" :weight 'light :height 0.8)
+    (set-face-attribute 'org-default nil :family "ETBembo")
+    ;; TODO Use Spacemacs' utilities instead?
+    (add-hook 'org-mode-hook 'buffer-face-mode)
+    (setq org-bullets-bullet-list '(" "))
     )
   )
 ;;; packages.el ends here