init-el/config/org-conf.el

111 lines
3.7 KiB
EmacsLisp

;;; org-conf.el --- orgmode configuration
;;;
;;; commentary:
;;; i use org-capture to store contents in ~/org
;;; then i use org-agenda to search through my captured items
;;; i use org-publish for my site, but that's not here.
;;; See docs/org.org for more info :D
;;;
;;; code:
;; Just a function to put the current filename into the clipboard.
(defun my-filename ()
(interactive)
(if buffer-file-name
(progn
(kill-new buffer-file-name)
(message (concat "Copied: " buffer-file-name)))
(message "Not inside a file!")))
(use-package org
:bind (("C-c o" . 'org-capture)
("C-c k" . 'my-filename)
("C-c a" . 'org-agenda)
:map org-mode-map
("C-c C-h" . org-emphasize)
("<f5>" . org-insert-heading-respect-content)
("<f6>" . org-insert-subheading)
("C-c q" . org-set-tags-command)
("C-<tab>" . org-next-link)
("C-<iso-lefttab>" . org-previous-link))
:hook (org-mode . prettify-symbols-mode)
:hook (org-mode . org-indent-mode)
:hook (org-mode . (lambda ()
(setq prettify-symbols-alist
'(("#+begin_src" . ?ᐁ)
("#+end_src" . ?ᐃ)))))
:config
(setq
org-cycle-include-plain-lists 'integrate
org-fontify-quote-and-verse-blocks t
org-special-ctrl-a t
org-hide-emphasis-markers t
org-startup-folded t
org-return-follows-link t
org-agenda-files '("~/org")
org-directory "~/org"
org-default-notes-file "notes.org"
org-indent-mode-turns-on-hiding-stars nil
org-todo-keywords '( "TODO(t)" "PROG(p)" "WAIT(w)" "|" "DONE(d)" "HELD(h)")
org-use-fast-tag-selection 'auto
org-fast-tag-selection-single-key t
org-use-fast-todo-selection t)
(setq org-tag-alist '(("interest" . ?i) ; Items I go "huh" about.
("recommend" . ?r) ; Stuff that got recommended to me.
("computers" . ?c) ; Computer / programming related.
("poetry" . ?p) ; A poem or verse.
("nothing" . ?n) ; Something to delete later.
("smolnet" . ?s) ; Gopher / smolweb related.
("house" . ?h))) ; housekeeping / planning
;; "* [[%^C][%^{DESC}]]\n%?" -- Prompt for clipboard content %^C, then for descriptoin.
(setq org-capture-templates ; info org "capture templates"
;; Key Name Type Organization File Headline Text
'(("j" "Journal" entry (file+olp+datetree "journ.org") "* %?")
("l" "Link")
("lo" "Online" entry (file "glinks.org") "* %?" :unnarrowed t)
("ll" "local" entry (file "bookm.org") "* %A%?")
("c" "Clocked" entry (clock) "* %?" :unnarrowed t)
("p" "Post" entry (file "grss.org") "* %?")
("t" "Todo")
("tt" "Standard" entry (file+headline "todo.org" "Tasks") "* TODO %?")
("tw" "To Watch" entry (file+headline "todo.org" "Watchlist") "* %? \n%a")
("tr" "Repeated" entry (file+headline "todo.org" "Repeating") "* %? \n")
("s" "Scratch" plain (file "scratch.org") "%?")
("n" "Note" entry (file+headline "notes.org" "Notes") "* %?\n%i"))))
(use-package org-capture
:bind (("C-c O" . 'org-capture-goto-target)))
;; Defining my todo labels
(use-package org-agenda
:bind (:map org-agenda-mode-map
("C-c q" . org-agenda-set-tags)
("n" . org-agenda-next-item)
("p" . org-agenda-previous-item))
:config
(setq org-agenda-custom-commands
'(("a" "My agenda"
((org-agenda-list nil nil 1)
(todo "PROG|NEXT|TODO")
(todo "WAIT|HELD")))
("b" "Bookmarks"
((org-agenda-list nil nil 1)
(search "Online")
(search "Local")
(search "Homes")
(search "Nothin"))))))
;; Use unicode bullet for list items.
(font-lock-add-keywords
'org-mode
'(("^ *\\([-]\\) "
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) ""))))))
(provide 'org-conf)
;;; org-conf.el ends here