refactor: Move Emacs config from system/ to projects/dotemacs/
- Delete deprecated system/ configuration files - Update projects/dotemacs/modules/ with reorganized config - Add .opencode/ directory for agent state - Clean up attachments and unused documentation files
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#+TITLE: Emacs Org-mode Configuration
|
||||
#+property: header-args :tangle ~/.emacs.d/modules/org.el
|
||||
#+TITLE: Org Mode Configuration
|
||||
#+PROPERTY: header-args :tangle yes
|
||||
|
||||
* Org Mode
|
||||
|
||||
** Basic setup
|
||||
|
||||
* Core Org Setup
|
||||
#+begin_src elisp
|
||||
(use-package org
|
||||
:config
|
||||
@@ -11,41 +14,130 @@
|
||||
("C-c c" . org-capture)
|
||||
:map org-mode-map)
|
||||
)
|
||||
(defvar org-directory (concat (getenv "HOME") "/org/"))
|
||||
#+end_src
|
||||
|
||||
* Agenda
|
||||
#+begin_src elisp
|
||||
(setq org-deadline-warning-days 7)
|
||||
(setq org-agenda-skip-additional-timestamps-same-entry t)
|
||||
(setq org-agenda-span 'fortnight)
|
||||
(setq org-agenda-tags-column 'auto)
|
||||
(setq org-agenda-skip-scheduled-if-deadline-is-shown t)
|
||||
(setq org-agenda-files (list
|
||||
(concat org-directory "/0_inbox/inbox.org")
|
||||
(concat org-directory "/0_inbox/org-gtd-tasks.org")
|
||||
)
|
||||
)
|
||||
(setq org-directory (expand-file-name "~/memex/"))
|
||||
#+end_src
|
||||
|
||||
* Capture and Protocol
|
||||
** Looks
|
||||
|
||||
Basic
|
||||
#+begin_src elisp
|
||||
(defvar org-pretty-entities t) ; Improve org mode looks
|
||||
(defvar org-hide-emphasis-markers t) ; Hide emphasis markup
|
||||
(defvar org-num-mode nil)
|
||||
(defvar org-startup-folded 'shw2levels)
|
||||
#+end_src
|
||||
|
||||
Indentation of headers
|
||||
#+begin_src elisp
|
||||
(defvar org-startup-indented t) ; Indent org heirarchy
|
||||
(defvar org-adapt-indentation t)
|
||||
(defvar org-hide-leading-stars t) ; Minimal Outline
|
||||
(defvar org-odd-levels-only nil)
|
||||
#+end_src
|
||||
|
||||
Indentation of lists
|
||||
#+begin_src elisp
|
||||
(setq org-list-demote-modify-bullet t)
|
||||
#+end_src
|
||||
|
||||
Org-modern
|
||||
#+begin_src elisp
|
||||
(use-package org-modern
|
||||
:ensure t
|
||||
:config
|
||||
;; Choose some fonts
|
||||
(set-face-attribute 'default nil :family "sans-serif")
|
||||
(set-face-attribute 'variable-pitch nil :family "sans-serif")
|
||||
(set-face-attribute 'org-modern-symbol nil :family "Iosevka")
|
||||
|
||||
;; Edit settings
|
||||
(defvar org-auto-align-tags nil)
|
||||
(defvar org-tags-column 0)
|
||||
(defvar org-catch-invisible-edits 'show-and-error)
|
||||
(defvar org-special-ctrl-a/e t)
|
||||
(defvar org-insert-heading-respect-content t)
|
||||
|
||||
;; Org styling, hide markup etc.
|
||||
(defvar org-hide-emphasis-markers t)
|
||||
(defvar org-pretty-entities t)
|
||||
|
||||
;; Agenda styling
|
||||
(defvar org-agenda-tags-column 0)
|
||||
(defvar org-agenda-block-separator ?─)
|
||||
(defvar org-agenda-time-grid
|
||||
'((daily today require-timed)
|
||||
(800 1000 1200 1400 1600 1800 2000)
|
||||
" ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄"))
|
||||
(defvar org-agenda-current-time-string
|
||||
"◀── now ─────────────────────────────────────────────────")
|
||||
|
||||
;; Ellipsis styling
|
||||
(defvar org-ellipsis "…")
|
||||
(set-face-attribute 'org-ellipsis nil :inherit 'default :box nil)
|
||||
|
||||
(global-org-modern-mode)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
Highlight Sourcecode Syntax
|
||||
#+begin_src elisp
|
||||
(setq org-src-fontify-natively t)
|
||||
(setq org-src-tab-acts-natively t)
|
||||
#+end_src
|
||||
|
||||
Images
|
||||
#+begin_src elisp
|
||||
(setq org-startup-with-inline-images t)
|
||||
(setq org-image-actual-width '(300))
|
||||
#+end_src
|
||||
|
||||
** Capture
|
||||
|
||||
#+begin_src elisp
|
||||
(defvar org-default-notes-file (concat org-directory "inbox.org"))
|
||||
#+end_src
|
||||
|
||||
*** Org-protocol
|
||||
|
||||
Linux configuration
|
||||
#+begin_src bash :tangle yes
|
||||
[Desktop Entry]
|
||||
Name=org-protocol
|
||||
Comment=Intercept calls from emacsclient to trigger custom actions
|
||||
Categories=Other;
|
||||
Keywords=org-protocol;
|
||||
Icon=emacs
|
||||
Type=Application
|
||||
Exec=emacsclient -- %u
|
||||
Terminal=false
|
||||
StartupWMClass=Emacs
|
||||
MimeType=x-scheme-handler/org-protocol;
|
||||
#+end_src
|
||||
|
||||
#+begin_src bash :tangle yes
|
||||
update-desktop-database ~/.local/share/applications/
|
||||
#+end_src
|
||||
|
||||
Basic configuration
|
||||
#+begin_src elisp
|
||||
(require 'org-protocol)
|
||||
(setq org-protocol-default-buffer-for-file-links "*scratch*")
|
||||
(defvar org-default-notes-file (concat org-directory "/0_inbox/inbox.org"))
|
||||
(setq org-protocol-default-template-key "L")
|
||||
(setq org-protocol-default-buffer-for-file-links "*scratch*") ; fixes 'no buffers remain to edit error for org-protocol capturer
|
||||
#+end_src
|
||||
|
||||
#+begin_src elisp :tangle ~/.emacs.d/custom.el
|
||||
(defvar org-capture-templates '(
|
||||
Org-protocol templates
|
||||
#+begin_src elisp :tangle yes
|
||||
(setq org-capture-templates '(
|
||||
("p" "Protocol"
|
||||
entry
|
||||
(file "0_inbox/inbox.org")
|
||||
(file "inbox.org")
|
||||
"* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?"
|
||||
)
|
||||
("L" "Protocol Link"
|
||||
entry
|
||||
(file "0_inbox/inbox.org")
|
||||
(file "inbox.org")
|
||||
"* %? [[%:link][%:description]]\n:PROPERTIES:\n:TITLE: %:description\n:URI: %:link\n:CREATED: %U\n:END:"
|
||||
:prepend nil
|
||||
:empty-lines 1
|
||||
@@ -56,14 +148,86 @@
|
||||
)
|
||||
#+end_src
|
||||
|
||||
* TODO Settings
|
||||
#+begin_src elisp
|
||||
(setq org-todo-keywords
|
||||
'(
|
||||
(sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
|
||||
(sequence "WAIT(w@/!)" "|" "CNCL(c@)")
|
||||
)
|
||||
)
|
||||
(setq org-enforce-todo-dependencies t)
|
||||
(setq org-log-into-drawer "LOGBOOK")
|
||||
(setq org-protocol-default-template-key "L")
|
||||
#+end_src
|
||||
|
||||
Convert Orgzly captures to org-protocol captures standard
|
||||
#+begin_src elisp
|
||||
(defun my/org-convert-orgzly-to-org-protocol ()
|
||||
"Reformat Orgzly bookmark at point to org-protocol bookmark."
|
||||
(interactive)
|
||||
(when (org-at-heading-p)
|
||||
(let ((headline (nth 4 (org-heading-components))))
|
||||
;; Find and store the link. Delete the link line.
|
||||
(search-forward-regexp "^https?://\\S-*" nil t)
|
||||
(let ((link (match-string 0)))
|
||||
(beginning-of-line)
|
||||
(kill-line)
|
||||
;; Delete any trailing blank spaces
|
||||
(org-back-to-heading)
|
||||
(end-of-line)
|
||||
(when (not (org-on-heading-p))
|
||||
(delete-char 1)
|
||||
)
|
||||
;; Set new headline
|
||||
(goto-char (org-entry-beginning-position))
|
||||
(org-edit-headline (format "[[%s][%s]]" link headline))
|
||||
;; Set new properties
|
||||
(org-set-property "TITLE" headline)
|
||||
(org-set-property "URI" link)
|
||||
(message "Reformatted Orgzly bookmark at point to org-protocol bookmark")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Exporting
|
||||
|
||||
#+begin_src elisp :tangle yes
|
||||
(setq org-export-with-smart-quotes t)
|
||||
(setq org-export-backends '(beamer html latex md))
|
||||
#+end_src
|
||||
|
||||
Export to EPUB
|
||||
#+begin_src elisp :tangle yes
|
||||
(use-package ox-epub)
|
||||
#+end_src
|
||||
|
||||
** org-attach
|
||||
|
||||
#+begin_src elisp
|
||||
(setq org-attach-id-dir (concat org-directory "/library"))
|
||||
#+end_src
|
||||
|
||||
** Enable shell scripting support in org-babel
|
||||
|
||||
#+begin_src elisp
|
||||
(defvar org-babel-do-load-languages 'org-babel-load-languages '((shell . t)))
|
||||
#+end_src
|
||||
|
||||
** Insert org-mode links from clipboard
|
||||
#+begin_src elisp :tangle yes
|
||||
(use-package org-cliplink
|
||||
:bind
|
||||
(("C-x p i" . org-cliplink))
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Deft
|
||||
#+begin_src elisp :tangle yes
|
||||
(use-package deft
|
||||
:commands (deft)
|
||||
:init
|
||||
(defvar deft-extensions '("org"))
|
||||
(defvar deft-recursive nil)
|
||||
(defvar deft-use-filename-as-title t)
|
||||
:config
|
||||
(defvar deft-directory org-directory)
|
||||
(defvar deft-recursive t)
|
||||
(defvar deft-strip-summary-regexp ":PROPERTIES:\n\\(.+\n\\)+:END:\n")
|
||||
(defvar deft-use-filename-as-title t)
|
||||
:bind ("C-c n d" . deft)
|
||||
)
|
||||
#+end_src
|
||||
Reference in New Issue
Block a user