Skip to content

Instantly share code, notes, and snippets.

@aaratha
Last active May 1, 2026 23:35
Show Gist options
  • Select an option

  • Save aaratha/41ae3f2fbeed8497b974b229aa25c875 to your computer and use it in GitHub Desktop.

Select an option

Save aaratha/41ae3f2fbeed8497b974b229aa25c875 to your computer and use it in GitHub Desktop.
A few package configs that make emacs look nice

Pretty Emacs Configs

Introduction

The following are a few package configs I use to make emacs look nice. This is not a drop-in solution. You will have to integrate my configs into your own setup manually.

I used the Emacs-Kick config as a starter template and made loads of edits manually and with LLMs for some custom functions. It works well for me, but of course be careful copying and pasting.

Enjoy!

Tweaks

Using built in patches from Homebrew-Emacs-Plus as well as a community patch for frame transparency and blurring that I maintain.

(add-to-list 'default-frame-alist '(undecorated-round . t))

(set-frame-parameter nil 'alpha-background 0.7) 
(set-frame-parameter nil 'ns-background-blur 30)

(set-frame-parameter nil 'ns-alpha-elements '(ns-alpha-all))

(setq mac-command-modifier 'meta)

(setq text-scale-mode-step 1.1)

Org-mode

(use-package org
  :ensure nil     
  :init
  (defun my/apply-org-heading-faces (&rest _)
    "Keep Org headings monospace and scaled by level."
    (set-face-attribute 'org-document-title nil :inherit 'fixed-pitch :weight 'bold :height 1.5)
    (set-face-attribute 'org-level-1 nil :inherit 'fixed-pitch :weight 'bold :height 1.2)
    (set-face-attribute 'org-level-2 nil :inherit 'fixed-pitch :weight 'bold :height 1.2)
    (set-face-attribute 'org-level-3 nil :inherit 'fixed-pitch :weight 'semi-bold :height 1.2)
    (set-face-attribute 'org-level-4 nil :inherit 'fixed-pitch :weight 'semi-bold :height 1.2)
    (set-face-attribute 'org-level-5 nil :inherit 'fixed-pitch :weight 'normal :height 1.2)
    (set-face-attribute 'org-level-6 nil :inherit 'fixed-pitch :weight 'normal :height 1.2)
    (set-face-attribute 'org-level-7 nil :inherit 'fixed-pitch :weight 'normal :height 1.2)
    (set-face-attribute 'org-level-8 nil :inherit 'fixed-pitch :weight 'normal :height 1.2))

  (defun +org-cycle-only-current-subtree-h (&optional arg)
    "Toggle the local fold at the point, and no deeper.
  `org-cycle's standard behavior is to cycle between three levels: collapsed,
  subtree and whole document. This is slow, especially in larger org buffer. Most
  of the time I just want to peek into the current subtree -- at most, expand
  *only* the current subtree.
  All my (performant) foldings needs are met between this and `org-show-subtree'
  (on zO for evil users), and `org-cycle' on shift-TAB if I need it."
    (interactive "P")
    (unless (or (eq this-command 'org-shifttab)
                (and (bound-and-true-p org-cdlatex-mode)
                     (or (org-inside-LaTeX-fragment-p)
                         (org-inside-latex-macro-p))))
      (save-excursion
        (org-beginning-of-line)
        (let (invisible-p)
          (when (and (org-at-heading-p)
                     (or org-cycle-open-archived-trees
                         (not (member org-archive-tag (org-get-tags))))
                     (or (not arg)
                         (setq invisible-p
                               (memq (get-char-property (line-end-position)
                                                        'invisible)
                                     '(outline org-fold-outline)))))
            (unless invisible-p
              (setq org-cycle-subtree-status 'subtree))
            (org-cycle-internal-local)
            t)))))

  (setq org-confirm-babel-evaluate nil)
  (setq org-babel-tangle-use-default-file-name nil) ;; optional
  (add-hook 'org-mode-hook
            (lambda ()
              (add-hook 'after-save-hook
                        'org-babel-tangle
                        nil 'local)))

  (add-hook 'org-mode-hook
            (lambda ()
              ;; (org-superstar-mode 1)
              (setq-local line-spacing 0.1)
              (visual-line-mode 1)
              (visual-wrap-prefix-mode 1)
              (org-modern-mode 1)
              (org-latex-preview 1)
              (org-fragtog-mode 1)
              ))

  (setq org-hide-emphasis-markers t)

  (setq org-pretty-entities t)

  ;; (setq org-superstar-leading-bullet ?\s)

  (setq org-superstar-prettify-item-bullets t)
  (setq org-superstar-item-bullet-alist '((?+ . ?▶) (?* . ?◇) (?- . ?-)))

  (setq org-format-latex-options
        (plist-put org-format-latex-options :scale 1.7))
  (setq org-format-latex-options
        (plist-put org-format-latex-options :background "Transparent"))


  ;; collapses headline when in subtree on normal text
  ;; (setq org-cycle-emulate-tab 'white)

  (setq org-agenda-files (quote ("~/OneDrive/org")))

  :config
  (my/apply-org-heading-faces)
  (advice-add 'load-theme :after #'my/apply-org-heading-faces)
  (add-hook 'org-tab-first-hook
            ;; Only fold the current tree, rather than recursively
            #'+org-cycle-only-current-subtree-h)
  :defer t)       ;; Defer loading Org-mode until it's needed.

Org-modern

I use Org-modern mainly for custom folding stars and the nice “—” divider markup included. Book-mode (mentioned later) includes nice svg tags and other features I prefer over org-modern.

(use-package org-modern
  :ensure t
  :custom
  (org-modern-fold-stars
   '(("" . "")
     ("" . "")
     ("" . "")
     ("" . "")))
   ;; '(("▶" . "▼")      ;; Some other bullets I've tried
   ;;   ("├󰁔⬝" . "└󰁔")
   ;;   (" ├󰁔" . " └󰁔")
   ;;   ("  ├󰁔" . "  └󰁔")))
   ;; '(("▶" . "▼")
   ;;   ("  ├󰁔" . "  ├󰁔")
   ;;   ("  │  ├󰁔" . "  │  ├󰁔")
   ;;   ("  │  │  ├󰁔" . "  │  │  ├󰁔")))   ;; More like indent-guides!
  :init
  (setq org-modern-hide-stars "  "))
  ;; (setq org-modern-hide-stars 'leading))

Nano Configs

These are my nano-specific configs, including book-mode. All courtesy of Rougier.

Nano-theme

Love nano-theme. It’s a bit overbearing in its changes, but it comes together cleanly.

(use-package nano-theme
  :ensure t
  :init
  (require 'nano-theme-support)
  (nano-mode)
  :config
  (load-theme 'nano-dark t) ;; Sets dark-mode to default
  (setq nano-fonts-use nil) ;; Allow font overrides elsewhere in config
  (load-theme 'nano-dark t))

Nano-modeline

Nano-modeline. Not featured in the included image, but it’s a must have for its cohesion with the rest of the setup.

;; Hide the standard mode-line globally. Must be setq-default since
;; mode-line-format is buffer-local — plain setq only affects one buffer.
(setq-default mode-line-format nil)
(use-package nano-modeline
  :ensure t
  :after nano-theme
  :hook
  (prog-mode            . nano-modeline-prog-mode)
  (text-mode            . nano-modeline-text-mode)
  (org-mode             . nano-modeline-org-mode)
  (pdf-view-mode        . nano-modeline-pdf-mode)
  (mu4e-headers-mode    . nano-modeline-mu4e-headers-mode)
  (mu4e-view-mode       . nano-modeline-mu4e-message-mode)
  (elfeed-show-mode     . nano-modeline-elfeed-entry-mode)
  (elfeed-search-mode   . nano-modeline-elfeed-search-mode)
  (term-mode            . nano-modeline-term-mode)
  (xwidget-webkit-mode  . nano-modeline-xwidget-mode)
  (messages-buffer-mode . nano-modeline-message-mode)
  (org-capture-mode     . nano-modeline-org-capture-mode)
  (org-agenda-mode      . nano-modeline-org-agenda-mode)
  :init
  (setq-default mode-line-format nil)
  :config
  (require 'nano-modeline)
  (nano-modeline-prog-mode t)
  :hook
  (after-init . nano-modeline-prog-mode))

Book-mode

Book-mode is very finicky and experimental. Use with caution. I’ve included several major configurations from the draft.org document in the repo’s article section.

(use-package book-mode
  :vc (:url "https://github.com/rougier/book-mode.git"
            :rev :newest)
  :ensure t
  ;; :hook ((org-mode . book-mode)    ;; Enters book-mode on loading org files
  ;;        (org-mode . my/book-mode-setup))
  :config
  (defun my/book-mode-setup ()
    ;; SVG tag mode
    (require 'svg-tag-mode)
    (setq svg-tag-tags
          `(("\\(:no\\)export:" .
             ((lambda (tag) (svg-tag-make "NO"
                                          :face 'org-meta-line
                                          :inverse t
                                          :crop-right t))))
            (":no\\(export:\\)" .
             ((lambda (tag) (svg-tag-make "EXPORT"
                                          :face 'org-meta-line
                                          :crop-left t))))
            ("\\(\\[PDF\\]\\)" .
             ((lambda (tag) (svg-tag-make "PDF"
                                          :face 'org-meta-line
                                          :inverse nil))
              (lambda () (interactive) (call-interactively 'org-bib-pdf))
              "Insert a new entry from a PDF file"))

            ("\\(\\[DOI\\]\\)" .
             ((lambda (tag) (svg-tag-make "DOI"
                                          :face 'org-meta-line
                                          :inverse nil))
              (lambda () (interactive) (call-interactively 'org-bib-doi))
              "Insert a new entry from a DOI"))

            ("\\(url:\\)[A-Za-z]+" .
             ((lambda (tag) (svg-tag-make "URL"
                                          :face 'nano-popout
                                          :inverse t
                                          :crop-right t))))
            ("url:\\([A-Za-z/\\.]+\\)" .
             ((lambda (tag) (svg-tag-make tag
                                          :face 'nano-popout
                                          :crop-left t))))

            ("\\(fig:\\)[A-Za-z]+" .
             ((lambda (tag) (svg-tag-make "FIG"
                                          :face 'nano-salient
                                          :inverse t
                                          :crop-right t))))
            ("fig:\\([A-Za-z]+\\)" .
             ((lambda (tag) (svg-tag-make tag
                                          :face 'nano-salient
                                          :crop-left t))))
            ))      
    (svg-tag-mode t)
    
    ;; Outer indent mode
    (setq org-hide-leading-stars nil)
    (when (derived-mode-p 'org-mode)
      (add-to-list 'font-lock-extra-managed-props 'display)
      (setq left-margin 7)
      (setq left-margin-width left-margin)
      (set-window-margins (selected-window) left-margin 0)
      (let ((margin-format (format "%%%ds" left-margin-width)))
        (font-lock-add-keywords nil
                                `(
                                  ("^#\\+begin_abstract.*?\\(\n\\)"
                                   1 '(face nil display " "))
                                  
                                  ("^\\(#\\+begin_abstract.*$\\)"
                                   1 '(face nano-default display (,(concat
                                                                    (propertize "Abstract."
                                                                                'face '(:inherit nano-strong)))
                                                                  append)))
                                  
                                  ("\\(\n#\\+end_abstract.*\\)$"
                                   1 '(face nano-default display (,(concat
                                                                    (propertize ""
                                                                                'face '(:inherit nano-strong)))
                                                                  append)))

                                  ("^#\\+begin_keywords.*?\\(\n\\)"
                                   1 '(face nil display " "))
                                  
                                  ("^\\(#\\+begin_keywords.*$\\)"
                                   1 '(face nano-default display (,(concat
                                                                    (propertize "Keywords:"
                                                                                'face '(:inherit nano-strong)))
                                                                  append)))
                                  
                                  ("\\(\n#\\+end_keywords.*\\)$"
                                   1 '(face nano-default display (,(concat
                                                                    (propertize ""
                                                                                'face '(:inherit nano-strong)))
                                                                  append)))

                                  ("^\\(\\- \\)\\(.*\\)$"
                                   1 '(face nano-default display ((margin left-margin)
                                                                  ,(propertize (format margin-format "")
                                                                               'face '(:inherit nano-default :weight light)) append)))

                                  ("^\\(\\*\\{1\\} \\)\\(.*\\)$"
                                   1 '(face nano-faded display ((margin left-margin)
                                                                ,(propertize (format margin-format "# ")
                                                                             'face '(:inherit nano-faded :weight light)) append))
                                   2 '(face bold append))

                                  ("^\\(\\*\\{2\\} \\)\\(.*\\)$"
                                   1 '(face nano-faded display ((margin left-margin)
                                                                ,(propertize (format margin-format "## ")
                                                                             'face '(:inherit nano-faded :weight light)) append))
                                   2 '(face bold append))

                                  ("^\\(\\*\\{3\\} \\)\\(.*\\)$"
                                   1 '(face nano-faded display ((margin left-margin)
                                                                ,(propertize (format margin-format "### ")
                                                                             'face '(:inherit nano-faded :weight light)) append))
                                   2 '(face bold append))

                                  ("^\\*\\{4\\} .*?\\(\n\\)"
                                   1 '(face nil display " - "))

                                  ("^\\(\\*\\{4\\} \\)\\(.*?\\)$"
                                   1 '(face nano-faded display ((margin left-margin)
                                                                ,(propertize (format margin-format "§ ")
                                                                             'face '(:inherit nano-faded :weight light))  append))
                                   2 '(face bold append)))))

      (font-lock-fontify-buffer)
      (visual-line-mode)))
  (remove-hook 'emacs-lisp-mode-hook 'book-mode)                                    
  (remove-hook 'python-mode-hook 'book-mode))

Conclusion

Let me know if I’m forgetting anything major. This is only a small subset of my actual setup, and several other packages and dependencies will be needed to replicate it.

Here are the major hits:

Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment