You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 KiB

Config

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.

(setq user-full-name "Francis Kore"
      user-mail-address "me@korefrancis.com")

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:


(setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
      doom-variable-pitch-font (font-spec :family "sans" :size 13))

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:

(setq doom-theme 'doom-one)

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!

(setq org-directory "~/org/")
(setq deft-directory "~/org/deft")
(setq org-superstar-headline-bullets-list '("⁖" "◉" "○" "✸" "✿"))

;; Startup folded
(setq org-startup-folded 'overview)

Setup Org TODO keywords

(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)")))

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'.

(setq display-line-numbers-type t)

Org Emphasis

;; this controls the color of bold, italic, underline, verbatim, strikethrough

(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

Org Roam Server

  (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)

Fancy Priorities

(setq org-fancy-priorities-list '((?A . "❗")
                                  (?B . "⬆")
                                  (?C . "⬇")
                                  (?D . "☕")
                                  (?1 . "⚡")
                                  (?2 . "⮬")
                                  (?3 . "⮮")
                                  (?4 . "☕")
                                  (?I . "Important")))

Org Noter

(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))

Org Agenda

(setq org-agenda-files "~/org/gtd")
(setq org-log-done t)

Super-Agenda


(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")))

Spelling

(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")

Write room

Configure Zen mode Automatically go to full screen mode when activated

(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))))))

Nov Mode

(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))

Treemacs

(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"))

Spray

(map! :leader
      :desc "Change to spray mode"
      "<f6>" #'spray-mode)

Mixed Pitch

(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))