48 lines
1.9 KiB
EmacsLisp
48 lines
1.9 KiB
EmacsLisp
;;; org.el --- Org appearance -*- lexical-binding: t; -*-
|
|
;;; Code:
|
|
|
|
;; Styled stars, bullets, tags, tables and blocks.
|
|
;; (use-package org-modern
|
|
;; :hook (org-mode . org-modern-mode))
|
|
|
|
(setq org-directory "~/Projects/notebook")
|
|
(setq org-startup-indented t ; visual indent per level, no real spaces
|
|
org-hide-emphasis-markers t ; *bold* shows bold, markers hidden
|
|
org-pretty-entities t ; \rarr, \alpha etc. as symbols
|
|
org-ellipsis " ▾" ; folded-heading marker
|
|
org-startup-folded 'show2levels ; open with headings only
|
|
org-fontify-whole-heading-line t
|
|
org-fontify-done-headline t
|
|
org-fontify-quote-and-verse-blocks t
|
|
org-src-fontify-natively t ; highlight src blocks with their own mode
|
|
org-src-tab-acts-natively t
|
|
org-edit-src-content-indentation 0
|
|
org-return-follows-link t)
|
|
|
|
;; org-modern's recommended settings.
|
|
(setq org-auto-align-tags nil
|
|
org-tags-column 0
|
|
org-catch-invisible-edits 'show-and-error
|
|
org-special-ctrl-a/e t
|
|
org-insert-heading-respect-content t)
|
|
|
|
(add-hook 'org-mode-hook #'visual-line-mode) ; wrap at window edge
|
|
(add-hook 'org-mode-hook (lambda () (display-line-numbers-mode -1))) ; prose reads better without
|
|
|
|
(defun my/notes-index ()
|
|
"Open the notes index."
|
|
(interactive)
|
|
(find-file (expand-file-name "index.org" org-directory)))
|
|
|
|
(keymap-global-set "C-c n" #'my/notes-index)
|
|
|
|
;; Evil's TAB (= C-i, jump-forward) shadows Org's. Rebind for Org buffers only.
|
|
(with-eval-after-load 'org
|
|
(evil-define-key 'normal org-mode-map
|
|
(kbd "TAB") #'org-cycle ; fold/unfold the heading at point
|
|
(kbd "<tab>") #'org-cycle ; GUI emits <tab>, so bind both
|
|
(kbd "RET") #'org-open-at-point
|
|
(kbd "<backtab>") #'org-shifttab)) ; S-TAB: cycle all headings
|
|
|
|
;;; org.el ends here
|