#+TITLE: Config #+STARTUP: overview Place your private configuration here! Remember, you do not need to run 'doom sync' after modifying this file! * Identity Some functionality uses this to identify you, e.g. GPG configuration, email clients, file templates and snippets. #+begin_src emacs-lisp (setq user-full-name "Francis Kore" user-mail-address "me@korefrancis.com") #+end_src * Doom Here are some additional functions/macros that could help you configure Doom: - `load!' for loading external *.el files relative to this one - `use-package!' for configuring packages - `after!' for running code after a package has loaded - `add-load-path!' for adding directories to the `load-path', relative to this file. Emacs searches the `load-path' when you load packages with `require' or `use-package'. - `map!' for binding new keys To get information about any of these functions/macros, move the cursor over the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). This will open documentation for it, including demos of how they are used. You can also try 'gd' (or 'C-c c d') to jump to their definition and see how they are implemented. ** Fonts Doom exposes five (optional) variables for controlling fonts in Doom. Here are the three important ones: + `doom-font' + `doom-variable-pitch-font' + `doom-big-font' -- used for `doom-big-font-mode'; use this for presentations or streaming. They all accept either a font-spec, font string ("Input Mono-12"), or xlfd font string. You generally only need these two: #+begin_src emacs-lisp (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) doom-variable-pitch-font (font-spec :family "sans" :size 13)) #+end_src ** Theme There are two ways to load a theme. Both assume the theme is installed and available. You can either set `doom-theme' or manually load a theme with the `load-theme' function. This is the default: #+begin_src emacs-lisp (setq doom-theme 'doom-one) #+end_src * Org ** Basic If you use `org' and don't want your org files in the default location below, change `org-directory'. It must be set before org loads! #+begin_src emacs-lisp (setq org-directory "~/org/") (setq deft-directory "~/org/deft") (setq org-superstar-headline-bullets-list '("⁖" "◉" "○" "✸" "✿")) ;; Startup folded (setq org-startup-folded 'overview) #+end_src ** Setup Org TODO keywords #+begin_src emacs-lisp (setq org-todo-keywords '((sequence "TODO(t)" "PROJ(p)" "NEXT(n)" "STRT(s)" "WAIT(w)" "HOLD(h)" "IDEA(i)" "|" "DONE(d)" "KILL(k)") (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)") (sequence "|" "OKAY(o)" "YES(y)" "NO(n)"))) #+end_src ** Line Number This determines the style of line numbers in effect. If set to `nil', line numbers are disabled. For relative line numbers, set this to `relative'. #+begin_src emacs-lisp (setq display-line-numbers-type t) #+end_src ** Org Emphasis ;; this controls the color of bold, italic, underline, verbatim, strikethrough #+begin_src emacs-lisp (setq org-emphasis-alist '(("*" (bold :slant italic :weight black )) ;; this make bold both italic and bold, but not color change ("/" (italic :foreground "dark salmon" )) ;; italic text, the text will be "dark salmon" ("_" underline :foreground "cyan" ) ;; underlined text, color is "cyan" ("=" (:background "snow1" :foreground "deep slate blue" )) ;; background of text is "snow1" and text is "deep slate blue" ("~" (:background "PaleGreen1" :foreground "dim gray" )) ("+" (:strike-through nil :foreground "dark orange" )))) (setq org-hide-emphasis-markers t) ;; hides the emphasis markers #+end_src ** Org Roam Server #+begin_src emacs-lisp (setq org-roam-server-host "127.0.0.1" org-roam-server-port 8080 org-roam-server-authenticate nil org-roam-server-export-inline-images t org-roam-server-serve-files nil org-roam-server-served-file-extensions '("pdf" "mp4" "ogv") org-roam-server-network-poll t org-roam-server-network-arrows nil org-roam-server-network-label-truncate t org-roam-server-network-label-truncate-length 60 org-roam-server-network-label-wrap-length 20) #+end_src ** Fancy Priorities #+begin_src emacs-lisp (setq org-fancy-priorities-list '((?A . "❗") (?B . "⬆") (?C . "⬇") (?D . "☕") (?1 . "⚡") (?2 . "⮬") (?3 . "⮮") (?4 . "☕") (?I . "Important"))) #+end_src ** Org Noter #+begin_src emacs-lisp (after! (:all org pdf-view)) (setq org-noter-notes-window-location 'other-frame org-noter-always-create-frame nil org-noter-hide-other nil org-noter-notes-search-path (list org-directory)) #+end_src ** Org Agenda #+begin_src emacs-lisp (setq org-agenda-files "~/org/gtd") (setq org-log-done t) #+end_src ** Super-Agenda #+begin_src emacs-lisp (use-package! org-super-agenda :init (setq org-agenda-skip-scheduled-if-done t org-agenda-skip-deadline-if-done t org-agenda-include-deadlines t org-agenda-block-separator nil org-agenda-tags-column 100 ;; from testing this seems to be a good value org-agenda-compact-blocks t org-agenda-start-day nil ;; i.e. today org-agenda-span 1 org-agenda-start-on-weekday nil) (setq org-super-agenda-groups '((:name "Next Items" :time-grid t :tag ("NEXT" "outbox")) (:name "Important" :priority "A") (:name "Quick Picks" :effort< "0:30") (:priority<= "B" :scheduled future :order 1))) :config (org-super-agenda-mode)) ;(setq org-super-agenda-groups '((:name "Today" ; :time-grid t ; :scheduled today) ; (:name "Due Today" ; :deadline today) ; (:name "Important" ; :priority "❗") ; (:name "Overdue" ; :deadline past) ; (:name "Due Soon" ; :deadline future) ; (:name "Big Outcomes" ; :tag "bo"))) #+end_src * Spelling #+begin_src emacs-lisp (setq ispell-program-name "aspell") (setq ispell-extra-args '("--sug-mode=ultra" "--lang=en_US")) (setq spell-fu-directory "~/.config/+STORE/dictionary") ;; Please create this directory manually. (setq ispell-personal-dictionary "~/.config/+STORE/dictionary/.pws") #+end_src * Write room Configure Zen mode Automatically go to full screen mode when activated #+begin_src emacs-lisp (setq writeroom-fullscreen-effect t) (setq global-whitespace-mode t whitespace-style '(face tabs tab-mark spaces space-mark trailing lines-tail newline newline-mark) whitespace-display-mappings '( (space-mark ?\ [?\u00B7] [?.]) (space-mark ?\xA0 [?\u00A4] [?_]) (newline-mark ?\n [?¬ ?\n]) (tab-mark ?\t [?\u00BB ?\t] [?\\ ?\t]))) (global-whitespace-mode +1) (setq +zen-text-scale 0.6) (after! writeroom-mode (add-hook 'writeroom-mode-hook (defun +zen-cleaner-org () (when (and (eq major-mode 'org-mode) writeroom-mode) (setq-local -display-line-numbers display-line-numbers display-line-numbers nil) (setq-local -org-indent-mode org-indent-mode) (org-indent-mode -1) (when (featurep 'org-superstar) (setq-local -org-superstar-headline-bullets-list org-superstar-headline-bullets-list ;; org-superstar-headline-bullets-list '("🙐" "🙑" "🙒" "🙓" "🙔" "🙕" "🙖" "🙗") org-superstar-headline-bullets-list '("🙘" "🙙" "🙚" "🙛") -org-superstar-remove-leading-stars org-superstar-remove-leading-stars org-superstar-remove-leading-stars t) (org-superstar-restart))))) (add-hook 'writeroom-mode-disable-hook (defun +zen-dirty-org () (when (eq major-mode 'org-mode) (setq-local display-line-numbers -display-line-numbers) (when -org-indent-mode (org-indent-mode 1)) (when (featurep 'org-superstar) (setq-local org-superstar-headline-bullets-list -org-superstar-headline-bullets-list org-superstar-remove-leading-stars -org-superstar-remove-leading-stars) (org-superstar-restart)))))) #+end_src * Nov Mode #+begin_src emacs-lisp (use-package! nov :mode ("\\.epub\\'" . nov-mode) :config (map! :map nov-mode-map :n "RET" #'nov-scroll-up) (defun doom-modeline-segment--nov-info () (concat " " (propertize (cdr (assoc 'creator nov-metadata)) 'face 'doom-modeline-project-parent-dir) " " (cdr (assoc 'title nov-metadata)) " " (propertize (format "%d/%d" (1+ nov-documents-index) (length nov-documents)) 'face 'doom-modeline-info))) (advice-add 'nov-render-title :override #'ignore) (defun +nov-mode-setup () (face-remap-add-relative 'variable-pitch :family "Merriweather" :height 1.4 :width 'semi-expanded) (face-remap-add-relative 'default :height 1.3) (setq-local line-spacing 0.2 next-screen-context-lines 4 shr-use-colors nil) (require 'visual-fill-column nil t) (setq-local visual-fill-column-center-text t visual-fill-column-width 80 nov-text-width 80) (visual-fill-column-mode 1) (hl-line-mode -1) (add-to-list '+lookup-definition-functions #'+lookup/dictionary-definition) (setq-local mode-line-format `((:eval (doom-modeline-segment--workspace-name)) (:eval (doom-modeline-segment--window-number)) (:eval (doom-modeline-segment--nov-info)) ,(propertize " %P " 'face 'doom-modeline-buffer-minor-mode) ,(propertize " " 'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive) 'display `((space :align-to (- (+ right right-fringe right-margin) ,(* (let ((width (doom-modeline--font-width))) (or (and (= width 1) 1) (/ width (frame-char-width) 1.0))) (string-width (format-mode-line (cons "" '(:eval (doom-modeline-segment--major-mode)))))))))) (:eval (doom-modeline-segment--major-mode))))) (add-hook 'nov-mode-hook #'+nov-mode-setup)) #+end_src * Treemacs #+begin_src emacs-lisp (after! treemacs (defvar treemacs-file-ignore-extensions '() "File extension which `treemacs-ignore-filter' will ensure are ignored") (defvar treemacs-file-ignore-globs '() "Globs which will are transformed to `treemacs-file-ignore-regexps' which `treemacs-ignore-filter' will ensure are ignored") (defvar treemacs-file-ignore-regexps '() "RegExps to be tested to ignore files, generated from `treeemacs-file-ignore-globs'") (defun treemacs-file-ignore-generate-regexps () "Generate `treemacs-file-ignore-regexps' from `treemacs-file-ignore-globs'" (setq treemacs-file-ignore-regexps (mapcar 'dired-glob-regexp treemacs-file-ignore-globs))) (if (equal treemacs-file-ignore-globs '()) nil (treemacs-file-ignore-generate-regexps)) (defun treemacs-ignore-filter (file full-path) "Ignore files specified by `treemacs-file-ignore-extensions', and `treemacs-file-ignore-regexps'" (or (member (file-name-extension file) treemacs-file-ignore-extensions) (let ((ignore-file nil)) (dolist (regexp treemacs-file-ignore-regexps ignore-file) (setq ignore-file (or ignore-file (if (string-match-p regexp full-path) t nil))))))) (add-to-list 'treemacs-ignored-file-predicates #'treemacs-ignore-filter)) (setq treemacs-file-ignore-extensions '(;; LaTeX "aux" "ptc" "fdb_latexmk" "fls" "synctex.gz" "toc" ;; LaTeX - glossary "glg" "glo" "gls" "glsdefs" "ist" "acn" "acr" "alg" ;; LaTeX - pgfplots "mw" ;; LaTeX - pdfx "pdfa.xmpi" )) (setq treemacs-file-ignore-globs '(;; LaTeX "*/_minted-*" ;; AucTeX "*/.auctex-auto" "*/_region_.log" "*/_region_.tex")) #+end_src * Spray #+begin_src emacs-lisp (map! :leader :desc "Change to spray mode" "" #'spray-mode) #+end_src * Mixed Pitch #+begin_src emacs-lisp (use-package! mixed-pitch :hook (org-mode . mixed-pitch-mode) :config (setq mixed-pitch-set-heigth t) (set-face-attribute 'variable-pitch nil :height 180)) #+end_src