2021-03-02 22:26:47 +00:00
|
|
|
|
;;; jlj-org.el --- Customize my org setup -*- lexical-binding: t -*-
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;; Anything that customizes org-mode goes here.
|
|
|
|
|
;; this could probably be cleaned up more but its fine for now.
|
|
|
|
|
;;; Code:
|
|
|
|
|
;; Initialise installed packages
|
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
|
(use-package org
|
|
|
|
|
:ensure t
|
|
|
|
|
:config
|
|
|
|
|
(progn
|
|
|
|
|
;;Org mode configuration
|
|
|
|
|
(require 'org) ; Enable Org mode
|
|
|
|
|
(setq ispell-program-name "/usr/local/bin/ispell") ; set flyspell's spellchecker
|
|
|
|
|
(add-hook 'org-mode-hook 'turn-on-flyspell) ; enable flyspell-mode in all org-mode enabled files
|
|
|
|
|
(setq org-src-fontify-natively t
|
|
|
|
|
org-src-window-setup 'current-window
|
|
|
|
|
org-src-strip-leading-and-trailing-blank-lines t
|
|
|
|
|
org-src-preserve-indentation t
|
|
|
|
|
org-src-tab-acts-natively t
|
|
|
|
|
x-selection-timeout 10 ;; this fixes a freeze when org-capture is called. lol.
|
|
|
|
|
org-edit-src-content-indentation 0)
|
|
|
|
|
|
|
|
|
|
(add-hook 'org-agenda-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(visual-line-mode -1)
|
|
|
|
|
(toggle-truncate-lines 1)))
|
|
|
|
|
(org-babel-do-load-languages
|
|
|
|
|
'org-babel-load-languages
|
|
|
|
|
'((python . t)
|
|
|
|
|
(matlab . t)
|
|
|
|
|
(restclient . t)
|
|
|
|
|
(shell . t)))
|
|
|
|
|
|
|
|
|
|
;; log state changes to a drawer
|
|
|
|
|
(setq org-log-into-drawer t)
|
2021-03-04 01:01:54 +00:00
|
|
|
|
(setq org-log-done 'time)
|
2020-01-04 22:53:01 +00:00
|
|
|
|
|
|
|
|
|
;; org-agenda configs
|
|
|
|
|
(setq org-habit-show-habits-only-for-today nil)
|
|
|
|
|
(setq org-agenda-repeating-timestamp-show-all nil)
|
|
|
|
|
(setq org-deadline-warning-days 1)
|
|
|
|
|
(setq org-global-properties
|
|
|
|
|
'(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
|
|
|
|
|
(setq org-columns-default-format
|
|
|
|
|
'(("%25ITEM %TODO %3PRIORITY %TAGS")))
|
2021-02-04 23:19:20 +00:00
|
|
|
|
;; have to add _archive or beorg throws a fit!!! it doesn't work on tags the dumby!
|
2021-09-04 21:37:24 +00:00
|
|
|
|
(setq org-archive-location "~/dhd/org/archive.org_archive::* From %s")
|
2021-02-04 23:19:20 +00:00
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
|
|
2020-03-02 01:21:20 +00:00
|
|
|
|
;;;; custom org mode hotkeys
|
2020-01-04 22:53:01 +00:00
|
|
|
|
(global-set-key "\C-cl" 'org-store-link)
|
|
|
|
|
(global-set-key "\C-ca" 'org-agenda)
|
|
|
|
|
(global-set-key "\C-cc" 'org-capture)
|
|
|
|
|
(global-set-key "\C-cb" 'org-iswitchb)
|
|
|
|
|
|
|
|
|
|
;;;; search across agenda files when refiling:
|
|
|
|
|
(setq org-refile-targets '((nil :maxlevel . 9)
|
|
|
|
|
(org-agenda-files :maxlevel . 9)))
|
|
|
|
|
(setq org-outline-path-complete-in-steps nil) ; Refile in a single go
|
|
|
|
|
(setq org-refile-use-outline-path t) ; Show full paths for refiling
|
2021-09-04 21:37:24 +00:00
|
|
|
|
(setq org-agenda-files '("~/dhd/org/")) ; add files to agenda
|
2021-08-20 23:04:07 +00:00
|
|
|
|
(find-file-noselect "~/Documents/projects/molly/data/matrix-refile.org")
|
2021-09-04 21:37:24 +00:00
|
|
|
|
(setq org-agenda-files (list "~/dhd/org"
|
2021-08-18 21:38:25 +00:00
|
|
|
|
"~/Documents/projects/molly/data/matrix-refile.org"))
|
|
|
|
|
(with-current-buffer "matrix-refile.org" (auto-revert-mode))
|
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
|
|
|
|
|
|
|
2021-09-04 21:37:24 +00:00
|
|
|
|
(setq org-directory "~/dhd/org/") ; define generic org capture shit
|
2020-01-04 22:53:01 +00:00
|
|
|
|
(setq org-default-notes-file (concat org-directory "/refile-beorg.org"))))
|
|
|
|
|
|
2021-02-14 01:41:44 +00:00
|
|
|
|
;; setup special block extras!
|
|
|
|
|
(use-package org-special-block-extras
|
|
|
|
|
:ensure t
|
|
|
|
|
:hook (org-mode . org-special-block-extras-mode)
|
|
|
|
|
:custom
|
|
|
|
|
;; The places where I keep my ‘#+documentation’
|
|
|
|
|
(org-special-block-extras--docs-libraries
|
2021-09-04 21:37:24 +00:00
|
|
|
|
'("~/dhd/org/documentation.org"))
|
2021-02-14 01:41:44 +00:00
|
|
|
|
;; Disable the in-Emacs fancy-links feature?
|
|
|
|
|
;; (org-special-block-extras-fancy-links nil)
|
|
|
|
|
;; Details heading “flash pink” whenever the user hovers over them?
|
|
|
|
|
(org-html-head-extra (concat org-html-head-extra "<style> summary:hover {background:pink;} </style>"))
|
|
|
|
|
;; The message prefixing a ‘tweet:url’ badge
|
|
|
|
|
(org-special-block-extras-link-twitter-excitement
|
|
|
|
|
"This looks super neat (•̀ᴗ•́)و:")
|
|
|
|
|
:config
|
|
|
|
|
;; Use short names like ‘defblock’ instead of the fully qualified name
|
|
|
|
|
;; ‘org-special-block-extras-defblock’
|
|
|
|
|
(org-special-block-extras-short-names))
|
2020-01-04 22:53:01 +00:00
|
|
|
|
|
|
|
|
|
;; Set up bullets
|
|
|
|
|
(use-package org-bullets
|
|
|
|
|
:ensure t
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
|
|
|
|
|
|
|
|
|
|
(use-package ob-restclient
|
|
|
|
|
:ensure t
|
|
|
|
|
:after org)
|
|
|
|
|
|
|
|
|
|
;; configure the org protocol
|
|
|
|
|
(org-load-modules-maybe t)
|
|
|
|
|
(require 'org-protocol)
|
2021-02-14 01:41:44 +00:00
|
|
|
|
;; (require 'org-protocol-capture-html)
|
2020-01-04 22:53:01 +00:00
|
|
|
|
(setq org-protocol-default-template-key "w")
|
|
|
|
|
|
|
|
|
|
(setq org-capture-templates
|
2021-09-04 21:37:24 +00:00
|
|
|
|
`(("w" "Web site" entry (file+olp "~/dhd/org/webwiki.org" "links" "unsorted")
|
2020-01-04 22:53:01 +00:00
|
|
|
|
"* %c :website:\n%U %?%:initial")
|
|
|
|
|
;; ... more templates here ...
|
2021-09-04 21:37:24 +00:00
|
|
|
|
("b" "Book - capture a book you've read" entry (file+olp "~/dhd/org/webwiki.org" "books")
|
2020-06-07 14:14:29 +00:00
|
|
|
|
"* %^{TITLE} \n :PROPERTIES:\n:AUTHOR: %^{AUTHOR}\n:GENRE: %^{GENRE}\n:FINISHED: %U \n:END:\n " :empty-lines 1 :prepend t)
|
2021-09-04 21:37:24 +00:00
|
|
|
|
("c" "Context-include Todo" entry (file "~/dhd/org/refile-beorg.org")
|
2020-01-04 22:53:01 +00:00
|
|
|
|
"* TODO %?\n%U \n '%a'" :empty-lines 1 :prepend t)
|
2021-09-04 21:37:24 +00:00
|
|
|
|
("q" "quotes" entry (file+olp "~/dhd/org/webwiki.org" "quotes")
|
2020-03-02 01:21:20 +00:00
|
|
|
|
"* %?\n%U \n " :empty-lines 1 :prepend t)
|
2021-09-04 21:37:24 +00:00
|
|
|
|
("t" "Todo" entry (file "~/dhd/org/refile-beorg.org")
|
2020-01-04 22:53:01 +00:00
|
|
|
|
"* TODO %?\n%U" :empty-lines 1 :prepend t)))
|
|
|
|
|
|
|
|
|
|
;; configure org exporters
|
|
|
|
|
(require 'ox-md)
|
|
|
|
|
|
|
|
|
|
;; org prettifiers
|
|
|
|
|
(setq org-agenda-format-date (lambda (date) (concat "\n"
|
|
|
|
|
(make-string (window-width) 9472)
|
|
|
|
|
"\n"
|
|
|
|
|
(org-agenda-format-date-aligned date))))
|
2020-06-20 21:54:06 +00:00
|
|
|
|
|
|
|
|
|
;; org mode hack for screenshots; see org mode hacks page.
|
|
|
|
|
(defun my-org-screenshot ()
|
2021-03-02 22:26:47 +00:00
|
|
|
|
"Take a screenshot and save a file.
|
|
|
|
|
The file is saved into a time stamped unique-named file in the same directory as the buffer.
|
|
|
|
|
Then insert a link to this file.reference: https://orgmode.org/worg/org-hacks.html
|
2020-06-21 00:02:49 +00:00
|
|
|
|
dependency: this relies on imagemagick"
|
2020-06-20 21:54:06 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(setq filename
|
|
|
|
|
(concat
|
|
|
|
|
(make-temp-name
|
2021-02-04 23:19:20 +00:00
|
|
|
|
(concat "pictures"
|
|
|
|
|
(buffer-file-name)
|
2020-06-20 21:54:06 +00:00
|
|
|
|
"_"
|
|
|
|
|
(format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
|
2020-06-21 00:02:49 +00:00
|
|
|
|
(if (eq system-type 'darwin)
|
|
|
|
|
(shell-command (format "screencapture -i %s" filename))
|
|
|
|
|
(call-process "import" nil nil nil filename))
|
2020-06-20 21:54:06 +00:00
|
|
|
|
(insert (concat "[[" filename "]]"))
|
|
|
|
|
(org-display-inline-images))
|
2020-06-20 21:55:33 +00:00
|
|
|
|
|
2020-06-21 16:46:33 +00:00
|
|
|
|
(if (eq system-type 'darwin)
|
|
|
|
|
(global-set-key (kbd "C-c C-M-4") 'my-org-screenshot)
|
|
|
|
|
(global-set-key (kbd "C-c C-4") 'my-org-screenshot))
|
2020-06-21 00:02:49 +00:00
|
|
|
|
|
|
|
|
|
|
2020-06-21 16:50:08 +00:00
|
|
|
|
;; force source blocks to respect the proper indentation.
|
2021-03-02 22:26:47 +00:00
|
|
|
|
(setq org-src-preserve-indentation nil
|
2020-06-21 16:50:08 +00:00
|
|
|
|
org-edit-src-content-indentation 0)
|
2021-02-26 20:47:36 +00:00
|
|
|
|
|
|
|
|
|
;; calender integration
|
2021-03-08 21:19:39 +00:00
|
|
|
|
|
|
|
|
|
(require 'epa)
|
|
|
|
|
(when (eq system-type 'darwin)
|
|
|
|
|
(setf epa-pinentry-mode 'loopback))
|
|
|
|
|
(setq auth-sources '("~/.emacs.d/jlj-secrets2.gpg"))
|
|
|
|
|
(setq auth-source-debug t)
|
|
|
|
|
|
2021-02-26 20:47:36 +00:00
|
|
|
|
(use-package org-caldav
|
|
|
|
|
:ensure t
|
|
|
|
|
:config
|
|
|
|
|
(setq org-caldav-sync-direction 'cal->org)
|
|
|
|
|
(setq org-caldav-url "https://caldav.fastmail.com/dav/calendars/user/me@jowj.net/")
|
|
|
|
|
(setq org-caldav-calendars
|
|
|
|
|
'((:calendar-id "654a6e55-b777-4603-b009-0058d35aa5ca"
|
2021-09-04 21:37:24 +00:00
|
|
|
|
:inbox "~/dhd/org/fromworkcal.org")))
|
2021-02-26 20:47:36 +00:00
|
|
|
|
(setq org-icalendar-timezone "America/Chicago"))
|
|
|
|
|
|
2021-03-02 22:26:47 +00:00
|
|
|
|
|
|
|
|
|
;;; jlj-org.el ends here
|