diff options
-rw-r--r-- | init.org | 86 |
1 files changed, 29 insertions, 57 deletions
@@ -320,7 +320,6 @@ Since Emacs 25 there is a new face for quoted expressions in Info manuals. By d This is my org mode configuration. Much of it is in one big blob and I haven’t yet taken the time to document it. #+BEGIN_SRC elisp -(require 'org-indent) (setq org-ellipsis "⤵") (setq org-src-fontify-natively t) @@ -349,17 +348,37 @@ This is my org mode configuration. Much of it is in one big blob and I haven’ (setq org-fontify-done-headline t) -(require 'org-bullets) -(setq org-bullets-bullet-list '("◉" "○" "◇" "◇")) -(add-hook 'org-mode-hook - (lambda () - (org-bullets-mode 1) - (variable-pitch-mode 1) - (visual-line-mode 1))) (defun gtd () (interactive) (find-file (concat org-directory "/master.org"))) +(use-package org-modern + :after org + :init + (set-face-background 'org-block-begin-line (face-attribute 'default :background)) + (setq + ;; Edit settings + org-auto-align-tags nil + org-tags-column 0 + org-fold-catch-invisible-edits 'show-and-error + org-special-ctrl-a/e t + org-insert-heading-respect-content t + + ;; Org styling, hide markup etc. + org-hide-emphasis-markers t + org-pretty-entities t + org-ellipsis "…" + + ;; Agenda styling + org-agenda-tags-column 0 + org-agenda-block-separator ?─ + org-agenda-time-grid + '((daily today require-timed) + (800 1000 1200 1400 1600 1800 2000) + " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") + org-agenda-current-time-string + "⭠ now ─────────────────────────────────────────────────") + (global-org-modern-mode)) #+END_SRC I can never remember the syntax for babel blocks. With =org-tempo= I can type =<s= and hit =tab= to expand it to a source block. @@ -369,52 +388,7 @@ I can never remember the syntax for babel blocks. With =org-tempo= I can type = :after org) #+end_src -I don’t like the way org-mode looks by default. It’s noisy, too colourful and seems old-fashioned to the point of being somewhat unattractive. This is why I find it important to change some of the default faces. - -Since I enable =variable-pitch-mode= in my org-mode buffers I also need to explicitly make a few faces inherit from the =fixed-width= face to be rendered with a monospaced font. - -#+BEGIN_SRC elisp -(set-face-attribute 'org-done nil :strike-through t) -(set-face-attribute 'org-headline-done nil - :strike-through t - :foreground "light gray") -(dolist (face '(org-block-begin-line - org-block-end-line - org-block - org-table - org-meta-line - org-document-info-keyword - org-special-keyword - org-verbatim - org-todo - org-tag - org-done - org-hide - org-indent - org-checkbox)) - (set-face-attribute face nil :inherit 'fixed-pitch)) - -(set-face-attribute 'org-tag nil - :foreground (face-attribute 'default :foreground) - :weight 'normal - :height (face-attribute 'default :height) - :overline nil - :underline nil - :box '(:line-width -1 :color "#859900")) -#+END_SRC - -To ensure that indented blocks line up with their headings despite using =variable-pitch-mode= we set the indentation character to =*= and hide it by setting the foreground colour to the same as the default background colour. - -#+BEGIN_SRC elisp -(setq org-indent-boundary-char ?*) -(set-face-attribute 'org-indent nil :foreground (face-attribute 'default :background)) -#+END_SRC - -=variable-pitch-mode= also makes it impossible to align tags at a fixed column, so I don’t. Instead I just let tags appear right behind the heading. - -#+BEGIN_SRC elisp -(setq org-tags-column 0) -#+END_SRC +I don’t like the way org-mode looks by default. It’s noisy, too colourful and seems old-fashioned to the point of being somewhat unattractive. The following snippet is an attempt to prettify the somewhat ugly headers of source code blocks in =org-mode=. The snippet was taken from [[https://pank.eu/blog/pretty-babel-src-blocks.html][the blog of Rasmus Pank]] and slightly modified to suit my needs. @@ -489,9 +463,7 @@ not very efficient and maybe should be implemented using overlays." (mapc (apply-partially 'add-to-list 'prettify-symbols-alist) (cl-reduce 'append (mapcar (lambda (x) (list x (cons (upcase (car x)) (cdr x)))) - `(("#+begin_src" . ?✎) ;; ➤ 🖝 ➟ ➤ ✎ - ("#+end_src" . ?□) ;; ⏹ - ("#+header:" . ,my/ob-header-symbol) + `(("#+header:" . ,my/ob-header-symbol) ("#+begin_quote" . ?«) ("#+end_quote" . ?»))))) (turn-on-prettify-symbols-mode) |