dotfiles/emacs/.config/emacs/Emacs.org

660 lines
20 KiB
Org Mode
Raw Normal View History

2025-03-04 22:31:03 -08:00
#+title: My Emacs Config
#+author: William Ball
2025-09-13 08:02:13 -07:00
#+email: wball@ballcloud.cc
2025-03-04 22:31:03 -08:00
#+property: header-args:emacs-lisp :tangle ./init.el :mkdirp
* Basic Settings
** UI
#+begin_src emacs-lisp
(setq inhibit-startup-message t)
(tool-bar-mode -1)
(tooltip-mode -1)
(set-fringe-mode 10)
(menu-bar-mode -1)
(setq visible-bell t)
(setq frame-resize-pixelwise t)
(fset 'yes-or-no-p 'y-or-n-p)
2026-02-18 13:48:29 -08:00
(setq default-frame-alist '((undecorated . t)))
2025-03-04 22:31:03 -08:00
(scroll-bar-mode -1)
#+end_src
** Backups
#+begin_src emacs-lisp
(defvar wball/backup-directory (concat user-emacs-directory "backups"))
(if (not (file-exists-p wball/backup-directory))
(make-directory wball/backup-directory t))
(setq backup-directory-alist `(("." . ,wball/backup-directory)))
(setq make-backup-files t
2025-03-23 10:49:48 -07:00
backup-by-copying t
version-control t
delete-old-versions t
auto-save-default t)
2025-03-04 22:31:03 -08:00
#+end_src
* Packages
2025-11-21 16:10:32 -08:00
** MELPA
2025-09-13 06:08:52 -07:00
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
2025-09-13 06:08:52 -07:00
#+end_src
2025-03-04 22:31:03 -08:00
** use-package
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(require 'use-package-ensure)
2025-03-04 22:31:03 -08:00
(setq use-package-always-ensure t)
#+end_src
2025-11-21 16:10:32 -08:00
** no-littering
#+begin_src emacs-lisp
(use-package no-littering)
#+end_src
2025-05-11 18:56:51 -07:00
** Set up path correctly
#+begin_src emacs-lisp
(use-package exec-path-from-shell
2025-09-13 06:08:52 -07:00
:config
(exec-path-from-shell-initialize))
2025-05-11 18:56:51 -07:00
#+end_src
2025-03-04 22:31:03 -08:00
** Automatic updates
#+begin_src emacs-lisp
(use-package auto-package-update
:custom
(auto-package-update-interval 7)
(auto-package-update-prompt-before-update t)
(auto-package-update-hide-results t)
:config
(auto-package-update-maybe)
(auto-package-update-at-time "09:00"))
#+end_src
* UI
** Icons
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(use-package nerd-icons
:custom
2026-02-18 13:48:29 -08:00
(nerd-icons-font-family "Iosevka Nerd Font"))
2025-03-04 22:31:03 -08:00
#+end_src
** Rainbow delimiters
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
#+end_src
** Fonts
#+begin_src emacs-lisp
(use-package fontaine
:config
(setq fontaine-presets
2025-03-23 10:49:48 -07:00
'((regular
2025-11-21 16:10:32 -08:00
:default-height 140)
2025-03-23 10:49:48 -07:00
(small
2025-11-21 16:10:32 -08:00
:default-height 90)
2025-03-23 10:49:48 -07:00
(large
:default-weight semilight
2025-11-21 16:10:32 -08:00
:default-height 160
2025-03-23 10:49:48 -07:00
:bold-weight extrabold)
(extra-large
:default-weight semilight
2025-11-21 16:10:32 -08:00
:default-height 190
2025-03-23 10:49:48 -07:00
:bold-weight extrabold)
(t
2026-01-06 15:31:50 -08:00
:default-family "Iosevka Nerd Font"
2025-03-23 10:49:48 -07:00
:default-weight normal
2025-11-21 16:10:32 -08:00
:variable-pitch-family "Libertinus Serif")))
2025-03-04 22:31:03 -08:00
(fontaine-set-preset 'regular))
#+end_src
** Which key
#+begin_src emacs-lisp
(use-package which-key
:defer 0
:diminish which-key-mode
:config
(which-key-mode)
(setq which-key-idle-delay 0.3))
#+end_src
2026-02-18 13:48:29 -08:00
** Hide Modeline
#+begin_src emacs-lisp
(use-package hide-mode-line)
#+end_src
2025-03-04 22:31:03 -08:00
** Theme
2025-05-11 18:56:51 -07:00
*** Modus Themes
#+begin_src emacs-lisp
2026-03-05 16:42:40 -08:00
;; (use-package emacs
;; :ensure nil
;; :config
;; (require-theme 'modus-themes)
;; (setq modus-themes-italic-constructs t
;; modus-themes-bold-constructs t
;; modus-themes-links '(no-underline background faint)
;; modus-themes-prompts '(bold intense)
;; modus-themes-mode-line '(borderless accented moody)
;; modus-themes-org-blocks 'gray-background
;; modus-themes-region '(bg-only no-extend))
;; (load-theme 'modus-operandi :no-confirm))
2025-11-21 16:10:32 -08:00
#+end_src
*** Autodark
#+begin_src emacs-lisp
2026-03-05 16:42:40 -08:00
;; (use-package auto-dark
;; :ensure t
;; :custom
;; (auto-dark-themes '((modus-vivendi) (modus-operandi)))
;; :init (auto-dark-mode))
2025-07-27 16:42:46 -07:00
#+end_src
2025-11-21 16:10:32 -08:00
*** Catpuccin
2025-09-13 06:08:52 -07:00
#+begin_src emacs-lisp
2026-03-05 16:42:40 -08:00
(use-package catppuccin-theme
:init (setq catppuccin-flavor 'mocha)
:config
(load-theme 'catppuccin :no-confirm))
2025-09-13 06:08:52 -07:00
#+end_src
2025-11-21 16:10:32 -08:00
** Ultra Scroll
2025-07-27 16:42:46 -07:00
#+begin_src emacs-lisp
(use-package ultra-scroll
2025-11-21 16:10:32 -08:00
:custom
(scroll-conservatively 3)
(scroll-margin 0)
2025-07-27 16:42:46 -07:00
:config
(ultra-scroll-mode 1))
#+end_src
* Functionality
** Navigation
*** Ace-Window
#+begin_src emacs-lisp
(use-package ace-window
:bind (("M-o" . ace-window)))
2025-03-04 22:31:03 -08:00
#+end_src
2025-11-21 16:10:32 -08:00
*** Avy
#+begin_src emacs-lisp
(use-package avy
:bind
(("C-:" . avy-goto-char)
("C-M-'" . avy-goto-char-2)
("M-g w" . avy-goto-word-1)
("M-g W" . avy-goto-word-0)))
#+end_src
2025-03-04 22:31:03 -08:00
* Completion
** Vertico
#+begin_src emacs-lisp
(use-package vertico
:init (vertico-mode)
:custom (vertico-cycle t))
#+end_src
** Savehist
#+begin_src emacs-lisp
2025-08-13 22:24:57 -07:00
(use-package emacs
2025-09-13 06:08:52 -07:00
:ensure nil
2025-03-04 22:31:03 -08:00
:init (savehist-mode))
#+end_src
** Orderless
#+begin_src emacs-lisp
(use-package orderless
:init
(setq completion-styles '(orderless flex)
2025-03-23 10:49:48 -07:00
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
2025-03-04 22:31:03 -08:00
#+end_src
** Corfu
#+begin_src emacs-lisp
(use-package corfu
:custom
(corfu-cycle t)
(corfu-auto nil)
(corfu-echo-documentation 0.25)
:init
(global-corfu-mode)
(setq tab-always-indent 'complete))
#+end_src
** Cape
#+begin_src emacs-lisp
(use-package cape
:init
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-history))
#+end_src
** Marginalia
#+begin_src emacs-lisp
(use-package marginalia
:after vertico
:init (marginalia-mode))
#+end_src
** Consult
#+begin_src emacs-lisp
(use-package consult
2025-03-23 10:49:48 -07:00
:bind (("C-c M-x" . consult-mode-command)
2025-03-04 22:31:03 -08:00
("C-c h" . consult-history)
("C-c k" . consult-kmacro)
("C-c m" . consult-man)
("C-c i" . consult-info)
([remap Info-search] . consult-info)
;; C-x bindings in `ctl-x-map'
2025-03-23 10:49:48 -07:00
("C-x M-:" . consult-complex-command)
("C-x b" . consult-buffer)
("C-x 4 b" . consult-buffer-other-window)
("C-x 5 b" . consult-buffer-other-frame)
("C-x t b" . consult-buffer-other-tab)
("C-x r b" . consult-bookmark)
("C-x p b" . consult-project-buffer)
;; Custom M-# bindings for fast register a
2025-03-04 22:31:03 -08:00
("M-#" . consult-register-load)
2025-03-23 10:49:48 -07:00
("M-'" . consult-register-store)
2025-03-04 22:31:03 -08:00
("C-M-#" . consult-register)
;; Other custom bindings
2025-03-23 10:49:48 -07:00
("M-y" . consult-yank-pop)
2025-03-04 22:31:03 -08:00
;; M-g bindings in `goto-map'
("M-g e" . consult-compile-error)
2025-03-23 10:49:48 -07:00
("M-g f" . consult-flymake)
("M-g g" . consult-goto-line)
("M-g M-g" . consult-goto-line)
("M-g o" . consult-outline)
2025-03-04 22:31:03 -08:00
("M-g m" . consult-mark)
("M-g k" . consult-global-mark)
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; M-s bindings in `search-map'
2025-03-23 10:49:48 -07:00
("M-s d" . consult-fd)
2025-03-04 22:31:03 -08:00
("M-s c" . consult-locate)
("M-s g" . consult-grep)
("M-s G" . consult-git-grep)
("M-s r" . consult-ripgrep)
("M-s l" . consult-line)
("M-s L" . consult-line-multi)
("M-s k" . consult-keep-lines)
("M-s u" . consult-focus-lines)
;; Isearch integration
("M-s e" . consult-isearch-history)
:map isearch-mode-map
2025-03-23 10:49:48 -07:00
("M-e" . consult-isearch-history)
("M-s e" . consult-isearch-history)
("M-s l" . consult-line)
("M-s L" . consult-line-multi)
2025-03-04 22:31:03 -08:00
;; Minibuffer history
:map minibuffer-local-map
2025-03-23 10:49:48 -07:00
("M-s" . consult-history)
("M-r" . consult-history))
2025-03-04 22:31:03 -08:00
:hook (completion-list-mode . consult-preview-at-point-mode)
:init
(advice-add #'register-preview :override #'consult-register-window)
(setq register-preview-delay 0.5)
(setq xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref)
:config
(consult-customize
consult-theme :preview-key '(:debounce 0.2 any)
consult-ripgrep consult-git-grep consult-grep
consult-bookmark consult-recent-file consult-xref
consult--source-bookmark consult--source-file-register
consult--source-recent-file consult--source-project-recent-file
:preview-key '(:debounce 0.4 any))
2025-03-23 10:49:48 -07:00
(setq consult-narrow-key "<"))
2025-03-04 22:31:03 -08:00
#+end_src
2025-08-13 22:24:57 -07:00
* Lsp
** eglot
#+begin_src emacs-lisp
(use-package eglot
2025-09-13 06:08:52 -07:00
:ensure nil
2025-08-13 22:24:57 -07:00
:bind (:map eglot-mode-map
("C-c l r" . eglot-rename)
("C-c l f" . eglot-format-buffer)
("C-c l a" . eglot-code-actions)
("C-c l q" . eglot-code-action-quickfix)
("C-c l d" . xref-find-definitions)
("C-c l i" . eglot-find-implementation)
("C-c l t" . eglot-find-type-definition)
("C-c l s" . xref-find-references)
("C-c l h" . eldoc)
("C-c l R" . eglot-restart-process)
("C-c l e" . eglot-errors-at-point))
(:map flymake-mode-map
("M-n" . flymake-goto-next-error)
("M-p" . flymake-goto-prev-error)))
#+end_src
** eldoc-box
#+begin_src emacs-lisp
(use-package eldoc-box
:hook (eglot-managed-mode . eldoc-box-hover-at-point-mode))
#+end_src
** Markdown
I don't really use markdown ([[Org Mode]] is a strict improvement imo), but it's handy for rendering documentation.
#+begin_src emacs-lisp
(use-package markdown-mode)
#+end_src
2025-03-04 22:31:03 -08:00
* Languages
** Agda
#+begin_src emacs-lisp
2025-12-12 07:56:01 -08:00
;; (load-file (let ((coding-system-for-read 'utf-8))
;; (shell-command-to-string "agda-mode locate")))
2025-03-04 22:31:03 -08:00
#+end_src
2025-04-16 21:44:39 -07:00
** PG
#+begin_src emacs-lisp
(use-package proof-general)
#+end_src
2025-11-21 16:10:32 -08:00
** Perga
2025-07-27 22:15:47 -07:00
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(use-package perga-mode
:vc (:url "https://forgejo.ballcloud.cc/wball/perga-mode.git"
:rev :latest))
2025-07-27 22:15:47 -07:00
#+end_src
2025-11-21 16:10:32 -08:00
** Scheme
2025-09-13 06:08:52 -07:00
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(use-package geiser)
(use-package geiser-chez
2025-09-13 06:08:52 -07:00
:custom
2025-11-21 16:10:32 -08:00
(geiser-chez-binary "chez"))
2025-09-13 06:08:52 -07:00
#+end_src
2025-11-24 17:32:29 -08:00
** Haskell
#+begin_src emacs-lisp
(use-package haskell-mode)
#+end_src
2025-03-04 22:31:03 -08:00
* Latex
** Auctex
#+begin_src emacs-lisp
2025-08-13 22:24:57 -07:00
(use-package tex
:ensure auctex
2025-03-04 22:31:03 -08:00
:hook
(LaTeX-mode . visual-line-mode)
(LaTeX-mode . flyspell-mode)
(LaTeX-mode . reftex-mode)
(LaTeX-mode . prettify-symbols-mode)
(LaTeX-mode . outline-minor-mode)
:custom
(TeX-auto-save t)
(TeX-parse-self t)
(TeX-master t)
(reftex-plug-in-to-AUCTeX t)
(preview-auto-cache-preamble t)
2025-11-21 16:10:32 -08:00
(preview-scale-function 0.50))
2025-03-04 22:31:03 -08:00
#+end_src
** CDLatex
#+begin_src emacs-lisp
(use-package cdlatex
:hook
(LaTeX-mode . #'turn-on-cdlatex)
:custom
(cdlatex-math-symbol-prefix ?\;))
#+end_src
** Yasnippet and laas
#+begin_src emacs-lisp
(use-package yasnippet
:config
(yas-global-mode 1))
#+end_src
#+begin_src emacs-lisp
(defun wball/beginning-of-word ()
2025-03-23 10:49:48 -07:00
"Return t if point is at the beginning of a word."
(eq (point) (car (bounds-of-thing-at-point 'word))))
2025-03-04 22:31:03 -08:00
(use-package laas
:hook ((LaTeX-mode . laas-mode)
(org-mode . laas-mode))
:custom
(laas-enable-auto-space nil)
:config
(aas-set-snippets 'laas-mode
:cond #'wball/beginning-of-word
"mk" (lambda () (interactive)
(yas-expand-snippet "\\\\($1\\\\)$0"))
"dm" (lambda () (interactive)
(yas-expand-snippet "\\[\n\t$1\n\\]"))
:cond (lambda () (and (wball/beginning-of-word) (texmathp)))
"set" (lambda () (interactive)
(yas-expand-snippet "\\\\{$1\\\\}$0"))
"empty" "\\emptyset"
"and" "\\wedge"
"or" "\\vee"
"forall" "\\forall"
"exists" "\\exists"
"notin" "\\notin"
"cap" "\\cap"
"cup" "\\cup"
:cond #'texmathp
"NN" "\\N"
"ZZ" "\\Z"
"QQ" "\\Q"
"oo" "\\circ"
"RR" "\\R"
"CC" "\\C"
"BB" "\\B"
"PP" "\\P"
"FF" "\\F"
"HH" "\\H"
2025-05-11 18:56:51 -07:00
"SS" "\\Ss"
"TT" "\\T"
2025-03-04 22:31:03 -08:00
"\\\\\\" "\\setminus"
"s=" "\\subseteq"
"s<" "\\subset"
"invs" "^{-1}"
"opl" "\\oplus"
"td" (lambda () (interactive)
(yas-expand-snippet "^{$1}$0"))
"__" (lambda () (interactive)
(yas-expand-snippet "_{$1}$0"))))
#+end_src
* Org Mode
** Org itself
2026-03-05 16:42:40 -08:00
#+begin_src elisp
(package-vc-install '(org-mode :url "https://code.tecosaur.net/tec/org-mode" :branch "dev"))
#+end_src
2025-11-21 16:10:32 -08:00
I use [[https://abode.karthinks.com/org-latex-preview/][this]] fork of org-mode in order to have amazing latex previews. /Make sure to follow the installation instructions!/ It's supposed to eventually be merged into org proper, which is very exciting. I'm already pretty dependent on this feature (the previews are just that good), so I'll have to use this until it gets merged, but that's fine with me.
2025-03-04 22:31:03 -08:00
#+begin_src emacs-lisp
2025-12-12 07:56:01 -08:00
(use-package org-mode
:load-path "~/dotfiles/emacs/.config/emacs/elpa/org-mode/lisp/"
2025-03-04 22:31:03 -08:00
:init
(setq org-list-allow-alphabetical t)
:custom
2025-11-21 16:10:32 -08:00
(org-log-into-drawer t)
2025-03-04 22:31:03 -08:00
(org-startup-indented t)
(org-hide-emphasis-markers t)
(org-startup-with-inline-images t)
(org-image-actual-width '(300))
(org-export-with-smart-quotes t)
(org-directory "~/Nextcloud/org")
2025-11-24 17:32:29 -08:00
(org-cite-global-bibliography '("~/Nextcloud/Documents/library.bib"))
2025-03-04 22:31:03 -08:00
(org-agenda-files `(,org-directory))
2025-11-21 16:10:32 -08:00
(org-todo-keywords
'((sequence "TODO" "VERIFY" "|" "DONE")))
2025-03-04 22:31:03 -08:00
(org-default-notes-file (mapcar (lambda (x) (concat org-directory x))
2025-03-23 10:49:48 -07:00
'("/todo.org" "/done.org")))
2025-09-13 06:08:52 -07:00
(org-latex-preview-mode-display-live t)
2025-03-04 22:31:03 -08:00
:config
2025-11-21 16:10:32 -08:00
(plist-put org-latex-preview-appearance-options
:page-width 0.8)
2025-07-31 21:08:37 -07:00
(setq org-format-latex-options (plist-put org-format-latex-options :scale 0.6))
(require 'ox-latex)
2025-09-13 06:08:52 -07:00
(require 'ox-beamer)
2025-11-21 16:10:32 -08:00
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist '("ltx" . "export latex"))
(add-to-list 'org-structure-template-alist '("pf" . "proof"))
(add-to-list 'org-structure-template-alist '("thm" . "theorem"))
(add-to-list 'org-structure-template-alist '("def" . "definition"))
(add-to-list 'org-structure-template-alist '("lem" . "lemma"))
2025-08-13 22:24:57 -07:00
:hook
(org-mode . visual-line-mode)
2025-09-13 06:08:52 -07:00
(org-mode . flyspell-mode)
(org-mode . org-latex-preview-mode))
2025-03-04 22:31:03 -08:00
#+end_src
2025-11-21 16:10:32 -08:00
** Org Noter
#+begin_src emacs-lisp
(use-package djvu)
(use-package nov)
(use-package org-noter)
#+end_src
** Olivetti
#+begin_src emacs-lisp
(use-package olivetti
:custom
(fill-column 80)
:hook
(org-mode . olivetti-mode))
#+end_src
** Mixed Pitch
#+begin_src emacs-lisp
(use-package mixed-pitch
:hook
(org-mode . mixed-pitch-mode))
#+end_src
2025-08-09 16:14:43 -07:00
** toki pona support
#+begin_src emacs-lisp
(with-eval-after-load 'ox
(add-to-list 'org-export-dictionary
'("Footnotes" ("tok" :default "toki anpa")))
(add-to-list 'org-export-dictionary
'("Author" ("tok" :default "jan toki")))
(add-to-list 'org-export-dictionary
2025-08-11 19:19:04 -07:00
'("Table of Contents" ("tok" :default "ni li lon lipu ni::")))
2025-08-09 16:14:43 -07:00
(add-to-list 'org-export-dictionary
'("Created" ("tok" :default "mi pali e ni lon tenpo"))))
#+end_src
2025-03-04 22:31:03 -08:00
** Prettify
#+begin_src emacs-lisp
(use-package org-modern
:hook ((org-mode . org-modern-mode)
2025-03-23 10:49:48 -07:00
(org-agenda-finalize . org-modern-agenda)))
2025-03-04 22:31:03 -08:00
#+end_src
2025-09-13 06:08:52 -07:00
** Simple Presentations
#+begin_src emacs-lisp
(use-package org-present)
#+end_src
2025-07-27 16:42:46 -07:00
** Org Bloggy stuff
#+begin_src emacs-lisp
(setq org-publish-project-alist
2025-08-11 19:19:04 -07:00
`(("org-posts"
:base-directory "~/repos/blog/posts/"
2025-11-21 16:10:32 -08:00
:publishing-directory "/ssh:server:~/blog/"
2025-07-27 16:42:46 -07:00
:base-extension "org"
:recursive t
:publishing-function org-html-publish-to-html
2025-08-11 19:19:04 -07:00
:author "William Ball"
:language "en"
2025-07-27 16:42:46 -07:00
:auto-sitemap t
2025-08-11 19:19:04 -07:00
:sitemap-filename "archive.org"
:sitemap-title "Archive"
2025-07-27 16:42:46 -07:00
:sitemap-style list
2025-08-11 19:19:04 -07:00
:sitemap-sort-files anti-chronologically
:html-head "<link rel=\"stylesheet\" href=\"/static/style.css\" type=\"text/css\"/><link rel=\"icon\" href=\"static/favicon.ico\"/>"
:html-preamble t
:html-preamble-format (("en" "<div class=\"blog-header\"><a href=\"archive.html\">Post Archive</a></div>")
("tok" "<div class=\"blog-header\"><a href=\"archive.html\">toki ante</a></div>"))
2025-07-27 16:42:46 -07:00
)
("org-pages"
:base-directory "~/repos/blog/pages/"
2025-11-21 16:10:32 -08:00
:publishing-directory "/ssh:server:~/blog/"
:base-extension "org"
:recursive t
:publishing-function org-html-publish-to-html
:author "William Ball"
:language "en"
:html-head "<link rel=\"stylesheet\" href=\"/static/style.css\" type=\"text/css\"/><link rel=\"icon\" href\"static/favicon.ico\"/>"
)
2025-08-11 19:19:04 -07:00
("org-static"
:base-directory "~/repos/blog/static/"
2025-11-21 16:10:32 -08:00
:publishing-directory "/ssh:server:~/blog/static/"
2025-08-11 19:19:04 -07:00
:base-extension "ico\\|ttf\\|css"
:publishing-function org-publish-attachment
:recursive t
)
("org-media"
:base-directory "~/repos/blog/media/"
2025-11-21 16:10:32 -08:00
:publishing-directory "/ssh:server:~/blog/media/"
2025-08-11 19:19:04 -07:00
:base-extension "png\\|svg\\|pdf\\|mp4\\|mp3\\|ogg"
:publishing-function org-publish-attachment
:recursive t
)
2025-08-13 22:24:57 -07:00
("org" :components ("org-posts" "org-static" "org-media" "org-pages"))
2025-08-11 19:19:04 -07:00
))
2025-07-27 16:42:46 -07:00
2025-08-11 19:19:04 -07:00
(use-package htmlize)
#+end_src
** Simple http server
#+begin_src emacs-lisp
(use-package simple-httpd)
2025-07-27 16:42:46 -07:00
#+end_src
2025-03-04 22:31:03 -08:00
* Pdfs
** Pdf tools
2025-11-21 16:10:32 -08:00
I'm running into weird performance issues with =pdf-tools=. I think it has to do with HiDPI. Pdfs are a little blurry without scaling set, but it's way better than without.
2025-03-04 22:31:03 -08:00
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(use-package pdf-tools
:custom
(pdf-view-use-scaling nil)
:config
(pdf-tools-install))
2025-03-04 22:31:03 -08:00
#+end_src
* Terminals/Shells
** Eshell
#+begin_src emacs-lisp
(defun wball/configure-eshell ()
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history)
(add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer)
(setq eshell-history-size 10000
2025-03-23 10:49:48 -07:00
eshell-buffer-maximum-lines 10000
eshell-history-ignoredups t
eshell-scroll-to-bottom-on-input t))
2025-03-04 22:31:03 -08:00
(use-package eshell
:ensure nil
:commands eshell
:hook (eshell-first-time-mode . wball/configure-eshell)
:bind (("C-c e" . eshell))
:config
(with-eval-after-load 'esh-opt
(setq eshell-destroy-buffer-when-process-dies t)))
2025-08-13 22:24:57 -07:00
(defalias 'eshell/ff 'find-file)
(defalias 'eshell/fo 'find-file-other-window)
#+end_src
2025-11-21 16:10:32 -08:00
** VTerm
2025-08-13 22:24:57 -07:00
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(use-package vterm)
2025-03-04 22:31:03 -08:00
#+end_src
** Dired
#+begin_src emacs-lisp
2025-08-13 22:24:57 -07:00
(use-package emacs
2025-09-13 06:08:52 -07:00
:ensure nil
2025-03-04 22:31:03 -08:00
:commands (dired dired-jump)
:custom ((dired-listing-switches "-agho --group-directories-first"))
:config
(require 'dired-x))
(use-package dired-hide-dotfiles
:hook (dired-mode . dired-hide-dotfiles-mode))
#+end_src
* Misc
** magit
#+begin_src emacs-lisp
2025-11-21 16:10:32 -08:00
(use-package transient
:ensure t)
(use-package magit
:after transient)
#+end_src
** Newsticker
#+begin_src emacs-lisp
(use-package newsticker
:ensure nil
:custom
(newsticker-url-list-defaults nil)
(newsticker-url-list
'(("Logic Arxiv" "https://rss.arxiv.org/rss/math.LO")
("Planet Emacslife" "https://planet.emacslife.com/atom.xml")
("It's Foss News" "https://news.itsfoss.com/latest/rss"))))
#+end_src
** Books
#+begin_src emacs-lisp
(defun wball/books ()
"Recursively search and open books from ~/Nextcloud/Books/."
(interactive)
(let* ((books-dir (expand-file-name "~/Nextcloud/Books/"))
(files (directory-files-recursively books-dir "\\.pdf$\\|\\.epub$\\|\\.djvu$" nil))
(relative-files (mapcar (lambda (f)
(string-remove-prefix books-dir f))
files))
(choice (completing-read "Book: " relative-files nil t)))
(when choice
(find-file (concat books-dir choice)))))
(global-set-key (kbd "C-c b") 'wball/books)
2025-03-04 22:31:03 -08:00
#+end_src