#+TITLE: Emacs Config #+AUTHOR: Jonathan Jenne / Inhji #+PROPERTY: header-args :tangle config.el #+auto_tangle: t * Header #+begin_src emacs-lisp ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- #+end_src * Table of Contents :toc: - [[#header][Header]] - [[#keybindings][Keybindings]] - [[#base-config][Base Config]] - [[#themes][Themes]] - [[#org-mode][Org Mode]] - [[#general-settings][General Settings]] - [[#org-export][Org Export]] - [[#org-capture][Org Capture]] - [[#org-agenda][Org Agenda]] - [[#packages][Packages]] - [[#hl-todo][hl-todo]] - [[#org-auto-tangle][org-auto-tangle]] - [[#org-drill][org-drill]] - [[#doom-modeline][doom-modeline]] - [[#evil-snipe][evil-snipe]] * Keybindings These keybindings extend the default doom bindings, either because the defaults were confusing to me or because the binding did not yet exist. | Key | Description | State | |------------+-------------------------+-------| | F12 | Show Org-Agenda | N | | Ctrl-Alt-+ | Increase Font Size | | | Ctrl-# | Toggle Line Comment | | | DEL | Up Directory | Dired | | F6 | Toggle Light/Dark Theme | | | F7 | Start Org-Drill | | #+begin_src emacs-lisp (map! :n "" #'org-agenda-list) (map! :n "" #'org-drill) (map! "C-M-+" #'doom/increase-font-size) (map! "C-#" #'comment-line) (evil-define-key 'normal dired-mode-map (kbd "DEL") 'dired-up-directory) #+end_src * Base Config #+begin_src emacs-lisp ;; Basic User Settings (setq user-full-name "Jonathan Jenne" user-mail-address "johnnie@posteo.de") ;; Default Shell ;; Useful if default system shell is not bash (setq shell-file-name (executable-find "bash")) ;; Display Line numbers (setq display-line-numbers-type t) #+end_src * Themes #+begin_src emacs-lisp (use-package! heaven-and-hell :ensure t :config (setq heaven-and-hell-theme-type 'dark) ;; Omit to use light by default (setq heaven-and-hell-themes '((light . doom-gruvbox-light) (dark . doom-gruvbox))) ;; Themes can be the list: (dark . (tsdh-dark wombat)) ;; Optionall, load themes without asking for confirmation. (setq heaven-and-hell-load-theme-no-confirm t) :hook (after-init . heaven-and-hell-init-hook) :bind (("" . heaven-and-hell-toggle-theme))) #+end_src * Org Mode ** General Settings #+begin_src emacs-lisp (setq +user-org-path "~/Notes/Org") (defun org-path (filename) (expand-file-name filename +user-org-path)) (after! org (setq org-directory +user-org-path org-src-tab-acts-natively t)) (add-to-list 'org-modules 'org-habit) #+end_src ** Org Export #+begin_src emacs-lisp (after! org (;; TOC Links will lead to errors when attempting ;; to export to HTML setq org-export-exclude-tags '("toc"))) (defun my-org-inline-css-hook (exporter) "Insert custom inline css" (when (eq exporter 'html) (let* ((dir (ignore-errors (file-name-directory (buffer-file-name)))) (path (concat dir "style.css")) (fallback-style (or (null dir) (null (file-exists-p path)))) (final (if fallback-style "~/.config/doom/style.css" path))) ;; <- set your own style file path (setq org-html-head-include-default-style t) (setq org-html-head (concat "\n"))))) ;; Org Export (add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook) #+end_src ** Org Capture :toc: #+begin_src emacs-lisp (after! org (setq +org-capture-notes-file (org-path "Notes.org") +org-capture-todo-file (org-path "Todo.org") +org-capture-journal-file (org-path "Journal.org") +org-capture-cooking-file (org-path "Cooking.org") +org-capture-nepali-file (org-path "Nepali.org"))) (after! org (setq org-capture-templates '(("t" "Personal Todo" entry (file+headline +org-capture-todo-file "Inbox") "* TODO %?\n" :prepend t) ("r" "Recipe" entry (file+headline +org-capture-cooking-file "Unsorted") "* NEVERMADE %? :PROPERTIES: :Author: :Source: :Sent_by: :Yield: :Prep_Time: :Cook_Time: :Total_Time: :Cost: :Description: :URL: :Added: %u :END: - [ ] Ingredient 1 1. First Step") ("n" "Nepali") ("nw" "Nepali Word" entry (file+headline +org-capture-nepali-file "Nepali Words") "* %^{Nepali Word} :drill:\n%\\1\n** Answer\n%^{Translation}" :prepend t :immediate-finish t) ("j" "Journal entries") ("jj" "Daily Journal" entry (file+olp+datetree +org-capture-journal-file) "* %U %?\n" :prepend t) ("jt" "Travel Journal" entry (file+headline +org-capture-journal-file "Travel") "* %U %?\n" :prepend t)))) #+end_src ** Org Agenda #+begin_src emacs-lisp (after! org (setq org-agenda-show-all-dates nil org-agenda-span 4 org-agenda-start-day "+0d" org-agenda-spillover-skip-function '(org-agenda-skip-entry-if 'todo 'done) org-agenda-time-grid '((daily today require-timed) (800 1000 1200 1400 1600 1800 2000) " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") org-agenda-current-time-string "◀── now ──────────────────────────────────────────────── \\o/" org-agenda-block-separator ?─ ;; Consider all org files part of the org-agenda org-agenda-files (list +user-org-path))) #+end_src * Packages ** hl-todo #+begin_src emacs-lisp (add-hook 'org-mode-hook #'hl-todo-mode) (after! hl-todo (setq hl-todo-keyword-faces '(("TODO" warning bold) ("FIXME" error bold) ("EXAMPLE" font-lock-keyword-face bold) ("HACK" font-lock-constant-face bold) ("DEPRECATED" font-lock-doc-face bold) ("NOTE" success bold) ("BUG" error bold) ("XXX" font-lock-constant-face bold)))) #+end_src ** org-auto-tangle #+begin_src emacs-lisp (use-package! org-auto-tangle :defer t :config (setq org-auto-tangle-default nil) :hook (org-mode . org-auto-tangle-mode)) #+end_src ** org-drill #+begin_src emacs-lisp (after! org-drill (setq org-drill-scope 'agenda)) #+end_src ** doom-modeline #+begin_src emacs-lisp (after! doom-modeline (setq doom-modeline-battery t) (setq doom-modeline-major-mode-icon t)) (add-hook 'doom-after-init-hook #'display-battery-mode) (add-hook 'doom-after-init-hook #'display-time-mode) #+end_src ** evil-snipe #+begin_src emacs-lisp (after! evil-snipe (setq evil-snipe-scope 'whole-visible)) #+end_src