Skip to content

Instantly share code, notes, and snippets.

@helpotters
Created March 14, 2021 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helpotters/6249029204d554b4369a77d089074468 to your computer and use it in GitHub Desktop.
Save helpotters/6249029204d554b4369a77d089074468 to your computer and use it in GitHub Desktop.
public org config

Config

Preamble

Personal Information

Let’s initialize our personal information so that we can mark our documents for ourselves and others..

;;; config.el -*- lexical-binding: t; -*-

Basic Settings

Rudimentary

(setq-default
 delete-by-moving-to-trash t
 x-stretch-cursor t
 uniquify-buffer-name-style 'forward
 tab-width 4
 )
(setq
 undo-limit 100000000
 evil-want-fine-undo t
 auto-save-default t
 ;; truncate-string-ellipsis "…"
 )
(setq
 ;; golden-ratio-mode t
 ;; golden-ratio-auto-scale t
 ;; golden-ratio-wide-adjust-factor 8.8
 )

Laptop settings

(unless (equal "Battery status not available"
               (battery))
  (display-battery-mode 1))

Modeline

(defun doom-modeline-conditional-buffer-encoding ()
  (setq-local doom-modeline-buffer-encoding
              (unless (or (eq buffer-file-coding-system 'utf-8-unix)
                          (eq buffer-file-coding-system 'utf-8)))))
(add-hook 'after-change-major-mode-hook #'doom-modeline-conditional-buffer-encoding)

Keybindings

(global-set-key (kbd "<f12>") 'org-agenda) ;; WHAT DO I DO ??
(global-set-key (kbd "<f9>") 'ivy-bibtex) ;; open up references
(global-set-key (kbd "<f6>") 'org-capture) ;; open up templates
(global-set-key (kbd "<f7>") 'org-columns) ;; toggle org buffer columns
(global-set-key (kbd "<f8>") 'org-agenda-columns) ;; toggle agenda columns
(global-set-key (kbd "<f5>") (lambda () (interactive) (find-file (concat org-base "projects/personal/personal.org")))) ;; open main life management file
(global-set-key (kbd "<menu>") (lambda () (interactive) (find-file (concat org-base "projects/personal/education.org")))) ;; open main life management file

Doom Emacs Aesthetics

Theming

Splash Screen

(setq fancy-splash-image "~/.doom.d/black-hole.png")

Colors

Fonts

(setq  doom-font (font-spec :family "JetBrains Mono" :size 18)
       doom-big-font (font-spec :family "JetBrains Mono" :size 36))

Relative Line Numbers

Rather than just counting the numbers from 1-XXX, we can set it relative to the current line we’re working. Perfect for moving around in evil.

(setq display-line-numbers-type 'relative)

Package Configuration

Org-Mode

Rudimentary

Directories

(setq org-base (expand-file-name "~/Dropbox/org/"))
(setq org-roam-directory "~/Dropbox/org/roam/")
(setq org-papers (expand-file-name (concat org-base "papers/")))
(setq org-directory org-base)

(setq org-hide-emphasis-markers t)

Keywords

We need rewrite the keywords that our agenda utilizes for todo tasks: namely we are going to prime our productivity by differentiating between the next task and a task; NEXT and TODO.

(after! org
  (setq
   org-todo-keywords '((sequence
                        "REPEAT(r)"
                        "NEXT(n)" ;; next task
                        "TODO(t@)" ;; A task
                        "PROG(g@)" ;; IN progress
                        "WAITING(w@)"
                        "PROJ(p@)"
                        "|"
                        "DONE(d)"
                        "CANCELED(c!)"
                        ))
   )
  )

Quality of Life

(setq enable-local-eval t)
(setq safe-local-eval-forms '((progn (org-agenda-list) (other-window 1))))
(setq org-log-into-drawer t)

org-habit

Org-habit is an existing module in org-mode, we will simply enable it to allow us to tag some repeated TODOs with the STYLE property of habit.

(add-to-list 'org-modules 'org-habit)

We’ll also change up the org-habit chain glyphs to something more aesthetically pleasing: the two to change are the completed days, current, and failed days.

;; (setq
;;  org-habit-completed-glyph 244
;;  org-habit-today-glyph 32

;;  )

org-agenda

Now we’ll also configure some basic point abouts our agenda-view, namely the default days for starting, deadlines, and only showing tasks and removing done tasks.

(after! org
  (setq
   org-agenda-start-day "0d" ;; View my agenda TODAY as the first item
   org-agenda-skip-scheduled-if-done t
   org-agenda-skip-deadline-if-done t
   org-agenda-skip-timestamp-if-done t
   org-agenda-current-time-string "Now"
   ;; org-agenda-breadcrumbs-separator ""
   org-agenda-block-separator '""
   org-agenda-span 1
   ;; org-agenda-compact-blocks t
   )
  )

org-super-agenda

We are breaking up our org-agenda into multiple views, the most important one being our daily view, followed by our nightly and weekly reviews.

(use-package! org-super-agenda
  :after org-agenda
  :init
  (setq org-agenda-custom-commands
        '( ;; all container
          ("c" "Concise Day View"
           (;; view container
            (alltodo "" ((org-agenda-overriding-header "")
                         (org-agenda-remove-tags)
                         (org-agenda-prefix-format "  %i %?-2 t%s")
                         (org-super-agenda-groups
                          '((:name " Habits"
                             :discard (:not (:habit t :and (:todo "REPEAT")))
                             :scheduled today
                             :order 1
                             )
                            (:discard (:anything))
                            )))
                     )

            (agenda "" ((org-agenda-overriding-header "") ;;(org-agenda-remove-tags)
                        ;; (defun foo ()
                        ;;   (let ((x (nth 1 (org-agenda-get-category))))
                        ;;     (if x
                        ;;         (concat "[ " (org-agenda-get-category-icon(list x)) " ]")
                        ;;       "")))

                        (org-agenda-prefix-format
                         '(
                           ;; (tags . " %i %-12:c%?-12t% s") ;; file name + org-agenda-entry-type
                           (agenda  . "  %?-12t% s")
                           (timeline  . " %?-i % s")
                           ;; (todo  . "(foo)")
                           ;; (tags  . " %i %-12:c")
                           ;; (search . " %i %-12:c")
                           ))
                        (org-agenda-prefix-format

                         )
                        (org-agenda-prefix-format
                         '(
                           ;; (tags . " %i %-12:c%?-12t% s") ;; file name + org-agenda-entry-type
                           (agenda  . "   %?-12t% s")
                           (timeline  . " %?-i % s")
                           (todo  . " %c-:i")
                           ;; (tags  . " %i %-12:c")
                           ;; (search . " %i %-12:c")
                           ))
                        (org-agenda-time-grid '((today)(800 1000 1200 1400 1600 1800 2000) "   " ""))
                        (org-super-agenda-groups
                         '((:name " Today's Schedule "
                            :discard (:property "STYLE")
                            :time-grid t
                            :date today
                            :scheduled today
                            :order 1
                            :discard(:anything)
                            )
                           (:discard(:anything)))
                         ))
                    )

            (alltodo "" ((org-agenda-overriding-header "") ;;(org-agenda-remove-tags)
                         (org-agenda-scheduled-leaders '("" "          "))
                         (org-agenda-prefix-format " %i %?-2 t%s")
                         ;; (org-agenda-time-grid '((today)(800 1000 1200 1400 1600 1800 2000) "   " ""))
                         (org-super-agenda-groups
                          '(
                            (:name " Missed "
                             :scheduled past
                             :date today
                             :order 1
                             )
                            (:discard (:anything)))
                          ))
                     )
            );;view container end
           );; concise view container end
          ("p" "Night Planning View"
           (;; view container
            (agenda "" ((org-agenda-overriding-header "Plan ahead. ") ;;(org-agenda-remove-tags)
                        ;; (org-agenda-scheduled-leaders '( '(defun org-agenda-get-category-icon) "          "))
                        ;; (org-agenda-prefix-format " %i %?-2 t%s")
                        (org-agenda-prefix-format
                         '(
                           ;; (tags . " %i %-12:c%?-12t% s") ;; file name + org-agenda-entry-type
                           (agenda  . "   %?-12t% s")
                           ;; (timeline  . " %?-i % s")
                           ;; (todo  . " %c")
                           ;; (tags  . " %i %-12:c")
                           ;; (search . " %i %-12:c")
                           ))
                        (org-agenda-time-grid '((weekly)(800 1000 1200 1400 1600 1800 2000) "   " ""))
                        (org-agenda-span 2)
                        (org-agenda-start-day "+1d")
                        (org-super-agenda-groups
                         '((:name " Tomorrow and Day After"
                            :time-grid t
                            :order 1
                            )
                           )
                         ))
                    )
            (alltodo "" ((org-agenda-overriding-header "")
                         (org-agenda-remove-tags)
                         (org-agenda-prefix-format "  %i %?-2 t%s")
                         (org-super-agenda-groups
                          '(
                            (:name "  Deadlines Approaching "
                             :deadline future
                             :order 1
                             )
                            (:discard(:anything))
                            )))
                     )



            (alltodo "" ((org-agenda-overriding-header "") ;;(org-agenda-remove-tags)
                         (org-agenda-scheduled-leaders '("" "          "))
                         (org-agenda-prefix-format " %i %?-2 t%s")
                         ;; (org-agenda-time-grid '((today)(800 1000 1200 1400 1600 1800 2000) "   " ""))
                         (org-super-agenda-groups
                          '((:auto-parent t))
                          ))
                     )
            );;view container end
           )
          ("e" "Tomes & Learning"
           (
            (alltodo "NEXT" ((org-agenda-overriding-header " Stay Focused ")
                             (org-agenda-remove-tags)
                             (org-agenda-prefix-format "  %i %?-2 t%s")
                             (org-super-agenda-groups
                              '((:log t)
                                (:name " Readings "
                                 :discard(:not (:category "reading"))
                                 :todo "NEXT"
                                 :order 1)
                                (:name " Assignments"
                                 :category "assignment"
                                 :todo "NEXT"
                                 :order 2)
                                (:discard (:anything)))
                              )))


            ;; (agenda "" ((org-agenda-overriding-header "Important Dates")
            ;;             (org-super-agenda-groups
            ;;              '((:name "Exams "
            ;;                 :time-grid t
            ;;                 :order 3)
            ;;                (:discard (:anything))))
            ;;             )
            ;;         )
            ) ;; container end
           )
          ("d" "Daily Glance"
           (
            (alltodo "" ((org-agenda-overriding-header "")
                         (org-super-agenda-groups
                          '((:log t)
                            (:name " UPCOMING "
                             :todo "NEXT"
                             :date today
                             :order 1
                             :discard (:anything))
                            (:name "Project Actions "
                             :todo "PROJ"
                             :discard (:not (:todo "NEXT"))
                             )
                            (:auto-group t)
                            )

                          )))


            (agenda "" ((org-agenda-overriding-header "")
                        (org-super-agenda-groups
                         '((:name " Today's Schedule "
                            :time-grid t
                            :date today
                            :order 3)
                           (:discard (:anything))))
                        )
                    )
            ) ;; container end
           ) ;; daily glance container end
          ("w" "Weekly Overview"
           (
            (agenda "" ((org-agenda-overriding-header " Here's Your Week ")
                        (org-agenda-remove-tags)
                        (org-agenda-span 7)
                        (org-agenda-prefix-format
                         '(
                           ;; (tags . " %i %-12:c%?-12t% s") ;; file name + org-agenda-entry-type
                           (agenda  . "  %?-12t% s")
                           (timeline  . " %?-i % s")
                           ;; (todo  . " %c")
                           ;; (tags  . " %i %-12:c")
                           ;; (search . " %i %-12:c")
                           ))
                        (org-agenda-start-day "-1d")
                        (org-super-agenda-groups
                         '((:log t)
                           (:name " "
                            :scheduled future
                            :todo "TODO"
                            :order 1)
                           ;; (:name " Assignments"
                           ;;  :children t
                           ;;  :auto-parent 't
                           ;;  :order 2)
                           ;; (:discard (:anything))
                           )
                         )))


            ;; (agenda "" ((org-agenda-overriding-header "Important Dates")
            ;;             (org-super-agenda-groups
            ;;              '((:name "Exams "

            ;;                 :time-grid t
            ;;                 :order 3)
            ;;                (:discard (:anything))))
            ;;             )
            ;;         )
            ) ;; container end
           ) ;; week container end
          ("q" "Quarter Overview"
           (
            (agenda "" ((org-agenda-overriding-header " Here's Your Week ")
                        (org-agenda-remove-tags)
                        (org-agenda-show-all-dates nil)
                        (org-agenda-entry-types '(:deadline))
                        (org-agenda-span 100) ;; 14 weeks
                        (org-agenda-prefix-format
                         '(
                           ;; (tags . " %i %-12:c%?-12t% s") ;; file name + org-agenda-entry-type
                           (agenda  . "  %?-12t% s")
                           ;; (timeline  . " %?-i % s")
                           ;; (todo  . " %c")
                           (tags  . " %i %-12:c")
                           ;; (search . " %i %-12:c")
                           ))
                        (org-agenda-start-day "-1d")
                        (org-super-agenda-groups
                         '((:log t)
                           (:name " "
                            :time-grid nil
                            :deadline future
                            :discard (:not (:deadline future))
                            :order 1)
                           )
                         )))

            ) ;; container end
           );; quarter view
          );; all views container end
        );; setq container end


  :config
  (org-super-agenda-mode)
  ) ;; use package end

category icons

;; (after! org
;;   (setq
;;    org-agenda-category-icon-alist `(
;;                                     ;; ("web dev" "~/Dropbox/Apps/png/web-dev.png" nil nil ((:width 36) (:height 36) (:aspect center))  )
;;                                     ;; ("education" "~/Dropbox/App/png/education.png" (:width 36) (:height 36) :aspect center)
;;                                     ;; ("lifting" "~/Dropbox/App/png/lifting.png" (:width 36) (:height 36) :aspect center )
;;                                     ;; ("health" "~/Dropbox/App/png/health.png")
;;                                     ("dnd" "~/Dropbox/App/png/dnd.png" nil nil :aspect center)
;;                                     ("linux" "~/Dropbox/App/png/linux.png")
;;                                     ("emacs" "~/Dropbox/App/png/emacs.png")
;;                                     )
;;    )
(after! org (setq org-agenda-category-icon-alist '(
                                                   ;; Education Cats
                                                   ("uni" "~/Dropbox/Apps/png/school.png" nil nil :ascent center)
                                                   ("reading" "~/Dropbox/Apps/png/chemistry-1.png" nil nil :ascent center)
                                                   ("homework" "~/Dropbox/Apps/png/chemistry.png" nil nil :ascent center)
                                                   ;; Interpersonal
                                                   ("meeting" "~/Dropbox/Apps/png/contacts.png" nil nil :ascent center)
                                                   ("zoom" "~/Dropbox/Apps/png/videoconference.png" nil nil :ascent center)
                                                   ("dnd" "~/Dropbox/Apps/png/icosahedron.png" nil nil :ascent center)
                                                   ;; Finances
                                                   ("real-estate" "~/Dropbox/Apps/png/eco-house.png" nil nil :ascent center)
                                                   ("investing" "~/Dropbox/Apps/png/accruals.png" nil nil :ascent center)
                                                   ("work" "~/Dropbox/Apps/png/work.png" nil nil :ascent center)
                                                   ;; Computers
                                                   ("linux" "~/Dropbox/Apps/png/linux.png" nil nil :ascent center) ;; computer maintence
                                                   ("emacs" "~/Dropbox/Apps/png/emacs.png" nil nil :ascent center) ;; emacs maintenence
                                                   ("web dev" "~/Dropbox/Apps/png/web-design.png" nil nil :ascent center)
                                                   ;; Health
                                                   ("exercise" "~/Dropbox/Apps/png/barbell.png" nil nil :ascent center)
                                                   ("health" "~/Dropbox/Apps/png/heart-1.png" nil nil :ascent center)
                                                   ("brain" "~/Dropbox/Apps/png/brain.png" nil nil :ascent center)
                                                   ;; Planning
                                                   ("plan" "~/Dropbox/Apps/png/filter-1.png" nil nil :ascent center)
                                                   )))

org-capture

(after! org
  (setq
   +org-capture-notes-file "captures/notes.org"
   +org-capture-todo-file "captures/todo.org"
   ;; Templates
   )
  )

org-ref

(setq org-ref-default-bibliography (list (concat org-papers "master.bib")))
(setq org-ref-pdf-directory (concat org-papers "zotero/storage/"))
(setq org-ref-notes-directory org-papers)
(setq org-ref-bibliography-notes (concat org-papers "master.org"))
(setq org-ref-completion-library 'org-ref-ivy-cite-completion)
(setq org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex)
(setq org-ref-notes-function 'orb-edit-notes)

ivy-bibtex

We are utilizing Zotero for managing our library. org-ref is fantastic, however it is not great at managing tags, links, and especially sci-hub integration.

(use-package! ivy-bibtex
  :after org
  :config
  )
(setq
 bibtex-completion-bibliography (concat org-base "papers/master.bib")
 bibtex-completion-pdf-field "file"
 bibtex-completion-library-path (concat org-papers "zotero/storage/")
 bibtex-completion-notes-path (concat org-base "papers/")
 )

org-noter

(use-package! org-noter
  :after (:any org pdf-view)
  :config
  (setq
   pdf-view-midnight-minor-mode t))

org-journal

(use-package! org-journal
  :after org
  :config
        (setq
        org-journal-dir (concat org-base "journal/")
        org-journal-date-prefix "#+TITLE: "
        org-journal-time-prefix "* "
        org-journal-date-format "%a, %Y-%m-%d"
        org-journalfile-format "%Y-%m-%d.org")
)

org-roam

org-roam-bibtex

org-roam-server

(use-package! org-roam-server
  :after org-roam
  :config
  (setq org-roam-server-host "127.0.0.1"
        org-roam-server-port 8080
        org-roam-server-authenticate nil
        org-roam-server-export-inline-images t
        org-roam-server-serve-files nil
        org-roam-server-served-file-extensions '("pdf" "mp4" "ogv")
        org-roam-server-network-poll t
        org-roam-server-network-arrows nil
        org-roam-server-network-label-truncate t
        org-roam-server-network-label-truncate-length 60
        org-roam-server-network-label-wrap-length 20))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment