Repository navigation
Expand file tree
/
Copy pathclean-init.html
More file actions
962 lines (909 loc) · 32.2 KB
/
Copy pathclean-init.html
File metadata and controls
962 lines (909 loc) · 32.2 KB
1
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- 2025-11-10 Mon 12:23 --><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Clean Init</title><meta name="author" content="panda" /><meta name="generator" content="Org Mode" /><style type="text/css"> #content { max-width: 60em; margin: auto; } .title { text-align: center; margin-bottom: .2em; } .subtitle { text-align: center; font-size: medium; font-weight: bold; margin-top:0; } .todo { font-family: monospace; color: red; } .done { font-family: monospace; color: green; } .priority { font-family: monospace; color: orange; } .tag { background-color: #eee; font-family: monospace; padding: 2px; font-size: 80%; font-weight: normal; } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .org-right { margin-left: auto; margin-right: 0px; text-align: right; } .org-left { margin-left: 0px; margin-right: auto; text-align: left; } .org-center { margin-left: auto; margin-right: auto; text-align: center; } .underline { text-decoration: underline; } #postamble p, #preamble p { font-size: 90%; margin: .2em; } p.verse { margin-left: 3%; } pre { border: 1px solid #e6e6e6; border-radius: 3px; background-color: #f2f2f2; padding: 8pt; font-family: monospace; overflow: auto; margin: 1.2em; } pre.src { position: relative; overflow: auto; } pre.src:before { display: none; position: absolute; top: -8px; right: 12px; padding: 3px; color: #555; background-color: #f2f2f299; } pre.src:hover:before { display: inline; margin-top: 14px;} /* Languages per Org manual */ pre.src-asymptote:before { content: 'Asymptote'; } pre.src-awk:before { content: 'Awk'; } pre.src-authinfo::before { content: 'Authinfo'; } pre.src-C:before { content: 'C'; } /* pre.src-C++ doesn't work in CSS */ pre.src-clojure:before { content: 'Clojure'; } pre.src-css:before { content: 'CSS'; } pre.src-D:before { content: 'D'; } pre.src-ditaa:before { content: 'ditaa'; } pre.src-dot:before { content: 'Graphviz'; } pre.src-calc:before { content: 'Emacs Calc'; } pre.src-emacs-lisp:before { content: 'Emacs Lisp'; } pre.src-fortran:before { content: 'Fortran'; } pre.src-gnuplot:before { content: 'gnuplot'; } pre.src-haskell:before { content: 'Haskell'; } pre.src-hledger:before { content: 'hledger'; } pre.src-java:before { content: 'Java'; } pre.src-js:before { content: 'JavaScript'; } pre.src-latex:before { content: 'LaTeX'; } pre.src-ledger:before { content: 'Ledger'; } pre.src-lisp:before { content: 'Lisp'; } pre.src-lilypond:before { content: 'Lilypond'; } pre.src-lua:before { content: 'Lua'; } pre.src-matlab:before { content: 'MATLAB'; } pre.src-mscgen:before { content: 'Mscgen'; } pre.src-ocaml:before { content: 'Objective Caml'; } pre.src-octave:before { content: 'Octave'; } pre.src-org:before { content: 'Org mode'; } pre.src-oz:before { content: 'OZ'; } pre.src-plantuml:before { content: 'Plantuml'; } pre.src-processing:before { content: 'Processing.js'; } pre.src-python:before { content: 'Python'; } pre.src-R:before { content: 'R'; } pre.src-ruby:before { content: 'Ruby'; } pre.src-sass:before { content: 'Sass'; } pre.src-scheme:before { content: 'Scheme'; } pre.src-screen:before { content: 'Gnu Screen'; } pre.src-sed:before { content: 'Sed'; } pre.src-sh:before { content: 'shell'; } pre.src-sql:before { content: 'SQL'; } pre.src-sqlite:before { content: 'SQLite'; } /* additional languages in org.el's org-babel-load-languages alist */ pre.src-forth:before { content: 'Forth'; } pre.src-io:before { content: 'IO'; } pre.src-J:before { content: 'J'; } pre.src-makefile:before { content: 'Makefile'; } pre.src-maxima:before { content: 'Maxima'; } pre.src-perl:before { content: 'Perl'; } pre.src-picolisp:before { content: 'Pico Lisp'; } pre.src-scala:before { content: 'Scala'; } pre.src-shell:before { content: 'Shell Script'; } pre.src-ebnf2ps:before { content: 'ebfn2ps'; } /* additional language identifiers per "defun org-babel-execute" in ob-*.el */ pre.src-cpp:before { content: 'C++'; } pre.src-abc:before { content: 'ABC'; } pre.src-coq:before { content: 'Coq'; } pre.src-groovy:before { content: 'Groovy'; } /* additional language identifiers from org-babel-shell-names in ob-shell.el: ob-shell is the only babel language using a lambda to put the execution function name together. */ pre.src-bash:before { content: 'bash'; } pre.src-csh:before { content: 'csh'; } pre.src-ash:before { content: 'ash'; } pre.src-dash:before { content: 'dash'; } pre.src-ksh:before { content: 'ksh'; } pre.src-mksh:before { content: 'mksh'; } pre.src-posh:before { content: 'posh'; } /* Additional Emacs modes also supported by the LaTeX listings package */ pre.src-ada:before { content: 'Ada'; } pre.src-asm:before { content: 'Assembler'; } pre.src-caml:before { content: 'Caml'; } pre.src-delphi:before { content: 'Delphi'; } pre.src-html:before { content: 'HTML'; } pre.src-idl:before { content: 'IDL'; } pre.src-mercury:before { content: 'Mercury'; } pre.src-metapost:before { content: 'MetaPost'; } pre.src-modula-2:before { content: 'Modula-2'; } pre.src-pascal:before { content: 'Pascal'; } pre.src-ps:before { content: 'PostScript'; } pre.src-prolog:before { content: 'Prolog'; } pre.src-simula:before { content: 'Simula'; } pre.src-tcl:before { content: 'tcl'; } pre.src-tex:before { content: 'TeX'; } pre.src-plain-tex:before { content: 'Plain TeX'; } pre.src-verilog:before { content: 'Verilog'; } pre.src-vhdl:before { content: 'VHDL'; } pre.src-xml:before { content: 'XML'; } pre.src-nxml:before { content: 'XML'; } /* add a generic configuration mode; LaTeX export needs an additional (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */ pre.src-conf:before { content: 'Configuration File'; } table { border-collapse:collapse; } caption.t-above { caption-side: top; } caption.t-bottom { caption-side: bottom; } td, th { vertical-align:top; } th.org-right { text-align: center; } th.org-left { text-align: center; } th.org-center { text-align: center; } td.org-right { text-align: right; } td.org-left { text-align: left; } td.org-center { text-align: center; } dt { font-weight: bold; } .footpara { display: inline; } .footdef { margin-bottom: 1em; } .figure { padding: 1em; } .figure p { text-align: center; } .equation-container { display: table; text-align: center; width: 100%; } .equation { vertical-align: middle; } .equation-label { display: table-cell; text-align: right; vertical-align: middle; } .inlinetask { padding: 10px; border: 2px solid gray; margin: 10px; background: #ffffcc; } #org-div-home-and-up { text-align: right; font-size: 70%; white-space: nowrap; } textarea { overflow-x: auto; } .linenr { font-size: smaller } .code-highlighted { background-color: #ffff00; } .org-info-js_info-navigation { border-style: none; } #org-info-js_console-label { font-size: 10px; font-weight: bold; white-space: nowrap; } .org-info-js_search-highlight { background-color: #ffff00; color: #000000; font-weight: bold; } .org-svg { }</style></head><body><div id="content" class="content"><h1 class="title">Clean Init</h1><div id="table-of-contents" role="doc-toc"><h2>Table of Contents</h2><div id="text-table-of-contents" role="doc-toc"><ul><li><a href="#org5284676">1. Emacs-forge Init</a><ul><li><a href="#org8b68170">1.1. Lexical Binding</a></li><li><a href="#org20456ed">1.2. Bootstrapping Straight.el</a><ul><li><a href="#org81c2ce0">1.2.1. Early-Init</a></li><li><a href="#orgb20afc3">1.2.2. Bootstrap code</a></li></ul></li><li><a href="#orgf05b545">1.3. Packages</a><ul><li><a href="#orgb1a08fc">1.3.1. Evil and its Evil Ecosystem</a></li><li><a href="#orgec31a6c">1.3.2. Vertico/Swiper/Orderless/Consult/Marginalia</a></li><li><a href="#org4b8f5de">1.3.3. Modeline</a></li><li><a href="#org8c2ca3b">1.3.4. Which-key</a></li><li><a href="#org2dd4d14">1.3.5. Hydra</a></li><li><a href="#org3ddc03a">1.3.6. Flycheck</a></li><li><a href="#orgd0db586">1.3.7. Helpful</a></li><li><a href="#orga20a69f">1.3.8. Magit</a></li><li><a href="#org11f8042">1.3.9. Assorted other packages</a></li></ul></li><li><a href="#orgbd8a892">1.4. Org and Org-Ecosystem</a><ul><li><a href="#orgbd0a240">1.4.1. Org</a></li><li><a href="#orgd2ff251">1.4.2. Org-Babel</a></li><li><a href="#org840b46d">1.4.3. Org-Roam</a></li></ul></li><li><a href="#org144c9d4">1.5. User Interface</a><ul><li><a href="#orge8cc8d7">1.5.1. Simple Tweaks</a></li><li><a href="#org3610628">1.5.2. Line Numbers</a></li><li><a href="#org08d9f43">1.5.3. Theme</a></li><li><a href="#org0311bc3">1.5.4. Fonts and related</a></li></ul></li><li><a href="#org62591db">1.6. Binds</a><ul><li><a href="#orgf6067a0">1.6.1. Space as Leader and submenus</a></li><li><a href="#orga7e2ad4">1.6.2. Global Keybinds</a></li><li><a href="#org15754b2">1.6.3. Other Keybinds</a></li></ul></li><li><a href="#org03fd702">1.7. Functions</a><ul><li><a href="#org9a20649">1.7.1. Tangle on Save</a></li><li><a href="#orgb8435d8">1.7.2. Variable-pitch-mode toggle</a></li></ul></li></ul></li></ul></div></div><p>Keeping this separate from my doom-emacs config for now.Loading it with emacs -q -l. That's why it's tangling to something that isn't in ~/.config/emacs</p><div id="outline-container-org5284676" class="outline-2"><h2 id="org5284676"><span class="section-number-2">1.</span> Emacs-forge Init</h2><div class="outline-text-2" id="text-1"></div><div id="outline-container-org8b68170" class="outline-3"><h3 id="org8b68170"><span class="section-number-3">1.1.</span> Lexical Binding</h3><div class="outline-text-3" id="text-1-1"><p>This stuff goes at the top of the file. Just yak-shaving.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>;;; -*- lexical-binding: t -*-</code></pre></div></div></div><div id="outline-container-org20456ed" class="outline-3"><h3 id="org20456ed"><span class="section-number-3">1.2.</span> Bootstrapping Straight.el</h3><div class="outline-text-3" id="text-1-2"></div><div id="outline-container-org81c2ce0" class="outline-4"><h4 id="org81c2ce0"><span class="section-number-4">1.2.1.</span> Early-Init</h4><div class="outline-text-4" id="text-1-2-1"><p>Disables use-package. This block tangles to early-init.el</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>;;; -*- lexical-binding: t -*-(setq package-enable-at-startup nil)</code></pre></div></div></div><div id="outline-container-orgb20afc3" class="outline-4"><h4 id="orgb20afc3"><span class="section-number-4">1.2.2.</span> Bootstrap code</h4><div class="outline-text-4" id="text-1-2-2"><p>Code required to set-up and use straight.el instead of use-package. Installs use-package (package configuration syntax I'm used to) but then has any use-package calls made to straight.el instead.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" (or (bound-and-true-p straight-base-dir) user-emacs-directory))) (bootstrap-version 7)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage))(straight-use-package 'use-package)(setq straight-use-package-by-default t)</code></pre></div></div></div></div><div id="outline-container-orgf05b545" class="outline-3"><h3 id="orgf05b545"><span class="section-number-3">1.3.</span> Packages</h3><div class="outline-text-3" id="text-1-3"></div><div id="outline-container-orgb1a08fc" class="outline-4"><h4 id="orgb1a08fc"><span class="section-number-4">1.3.1.</span> Evil and its Evil Ecosystem</h4><div class="outline-text-4" id="text-1-3-1"><p>Mwahahaha.</p><p>evil-undo, by default, undoes everything since the last time you entered insert mode. fine-undo will use smaller changes as undo steps.</p><p>undo-limit is set really, really high because this isn't 1985 anymore and I don't have to account for the use of every byte</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package evil :init (setq evil-want-fine-undo t undo-limit 900000 evil-want-integration t evil-want-keybinding nil evil-undo-system 'undo-fu) :config (evil-mode 1)) (use-package evil-collection :after evil :config (evil-collection-init)) (use-package evil-goggles)</code></pre></div></div></div><div id="outline-container-orgec31a6c" class="outline-4"><h4 id="orgec31a6c"><span class="section-number-4">1.3.2.</span> Vertico/Swiper/Orderless/Consult/Marginalia</h4><div class="outline-text-4" id="text-1-3-2"><p>Completion Stack Plus Swiper.</p><p>I use swiper since it seems like you need to do extra work to make consult-line work like swiper. Future task TODO.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package swiper)(use-package vertico :config (setq vertico-cycle t) (setq vertico-resize nil) (vertico-mode 1))(use-package orderless :custom (completion-styles '(orderless basic)))(use-package consult :config (add-to-list 'consult-buffer-filter "^\\*")) ;; hides temp files from consult-buffer(use-package marginalia :init (marginalia-mode))</code></pre></div></div></div><div id="outline-container-org4b8f5de" class="outline-4"><h4 id="org4b8f5de"><span class="section-number-4">1.3.3.</span> Modeline</h4><div class="outline-text-4" id="text-1-3-3"><p>I'd like to configure this some more</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code> (use-package doom-modeline :custom (doom-modeline-height 200) (doom-modeline-percent-position nil)) ;; chonk;; define the custom modeline (doom-modeline-def-modeline 'mei-dline '(modals parrot matches buffer-info buffer-position remote-host selection-info) '(misc-info input-method process vcs check major-mode)) ;;make the mei-dline default (add-hook 'doom-modeline-mode-hook (lambda () (doom-modeline-set-modeline 'mei-dline 'default))) (setq doom-modeline-mode-alist nil) (doom-modeline-mode 1)(use-package nyan-mode :config (nyan-mode) (nyan-toggle-wavy-trail) (nyan-start-animation))</code></pre></div><div class="org-src-container"><pre class="src src-emacs-lisp"><code>;; (use-package doom-modeline;; :custom;; (doom-modeline-height 20);; (doom-modeline-hud t);; (doom-modeline-buffer-encoding nil);; (doom-modeline-percent-position nil);; :init;; (doom-modeline-mode 1))</code></pre></div></div></div><div id="outline-container-org8c2ca3b" class="outline-4"><h4 id="org8c2ca3b"><span class="section-number-4">1.3.4.</span> Which-key</h4><div class="outline-text-4" id="text-1-3-4"><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package which-key :init (which-key-mode) :diminish which-key-mode :config (setq which-key-idle-delay 0.3))</code></pre></div></div></div><div id="outline-container-org2dd4d14" class="outline-4"><h4 id="org2dd4d14"><span class="section-number-4">1.3.5.</span> Hydra</h4><div class="outline-text-4" id="text-1-3-5"><p>Provides transient keybindings. This seems very useful, need to investigate more. Already getting a lot of use out the sample one.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package hydra)(defhydra hydra-text-scale (:timeout 4) "scale text" ("o" text-scale-increase "in") ("k" text-scale-decrease "out") ("f" nil "finished" :exit t))</code></pre></div></div></div><div id="outline-container-org3ddc03a" class="outline-4"><h4 id="org3ddc03a"><span class="section-number-4">1.3.6.</span> Flycheck</h4><div class="outline-text-4" id="text-1-3-6"><p>Not fully configured yet; but this will get basic syntax checking done.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package flycheck :diminish flycheck-mode :config (flycheck-mode t))</code></pre></div></div></div><div id="outline-container-orgd0db586" class="outline-4"><h4 id="orgd0db586"><span class="section-number-4">1.3.7.</span> Helpful</h4><div class="outline-text-4" id="text-1-3-7"><p>Code pulled from dirty-init.el based from EFS. I don't use counsel anymore, so I need to investigate if I still want this.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>;; (straight-use-package 'helpful;; :ensure t;; :custom;; (counsel-describe-function-function #'helpful-callable);; (counsel-describe-variable-function #'helpful-variable);; :bind;; ([remap describe-function] . counsel-describe-function);; ([remap describe-command] . helpful-command);; ([remap describe-variable] . counsel-describe-variable);; ([remap describe-key] . helpful-key))</code></pre></div></div></div><div id="outline-container-orga20a69f" class="outline-4"><h4 id="orga20a69f"><span class="section-number-4">1.3.8.</span> Magit</h4><div class="outline-text-4" id="text-1-3-8"><p>Is it Mag-it or Maggot?</p><p>Throws an error when loaded right now. Too tired to figure out what's going on so will just disable it for now and use git in terminal.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>;; (use-package magit)</code></pre></div></div></div><div id="outline-container-org11f8042" class="outline-4"><h4 id="org11f8042"><span class="section-number-4">1.3.9.</span> Assorted other packages</h4><div class="outline-text-4" id="text-1-3-9"><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package vterm)(use-package vterm-toggle)(use-package fish-mode)(use-package smartparens :hook (prog-mode . smartparens-mode))(require 'smartparens-config)(use-package general) ;; for binding. binds declared later in the file(use-package docker-compose-mode)(use-package systemd)(use-package hl-todo :hook (org-mode . hl-todo-mode))(use-package undo-fu)(use-package spacious-padding :config (spacious-padding-mode))(use-package parrot)(use-package zone-nyan :config (setq zone-programs [zone-nyan]) (setq zone-timer 120))(use-package minimal-dashboard :init (setq minimal-dashboard-image-path "~/emacs-forge/pandaz2.png") (setq initial-buffer-choice #'minimal-dashboard))</code></pre></div></div></div></div><div id="outline-container-orgbd8a892" class="outline-3"><h3 id="orgbd8a892"><span class="section-number-3">1.4.</span> Org and Org-Ecosystem</h3><div class="outline-text-3" id="text-1-4"><p>Lets be honest here, this is the real star of the show</p></div><div id="outline-container-orgbd0a240" class="outline-4"><h4 id="orgbd0a240"><span class="section-number-4">1.4.1.</span> Org</h4><div class="outline-text-4" id="text-1-4-1"><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package org ;; makes org happen :custom (org-startup-with-inline-images t) (org-startup-indented t) (org-startup-folded t))(use-package org-modern ;; makes org pretty :custom (org-modern-star '("◉" "○" "◈" "◇" "*" "◇" "*")) (org-ellipsis " ▼") (org-auto-align-tags nil) (org-tags-column 0) (org-fold-catch-invisible-edits 'show-and-error) (org-special-ctrl-a/e t) (org-insert-heading-respect-content t) (org-hide-emphasis-markers t) (org-pretty-entities t) :config (global-org-modern-mode)) (use-package org-appear ;; makes org a bit sneakier :hook (org-mode . org-appear-mode) :custom (org-hide-emphasis-markers t) (org-appear-autolinks 'just-brackets))</code></pre></div></div></div><div id="outline-container-orgd2ff251" class="outline-4"><h4 id="orgd2ff251"><span class="section-number-4">1.4.2.</span> Org-Babel</h4><div class="outline-text-4" id="text-1-4-2"><p>TODO: Work in progress</p><p>Org-autocomplete structure templates. typing < and then a two-letter code will fill in the rest of that entry, eg <el will replace with src emacs-lisp</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code> (with-eval-after-load 'org (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t))))(require 'org-tempo)(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))(add-to-list 'org-structure-template-alist '("sh" . "src shell"))(add-to-list 'org-structure-template-alist '("fi" . "src fish"))(add-to-list 'org-structure-template-alist '("co" . "src conf-unix"))(add-to-list 'org-structure-template-alist '("cs" . "src css"))(add-to-list 'org-structure-template-alist '("js" . "src json"))(add-to-list 'org-structure-template-alist '("sd" . "src systemd"))(add-to-list 'org-structure-template-alist '("dc" ."docker-compose-mode"))</code></pre></div></div></div><div id="outline-container-org840b46d" class="outline-4"><h4 id="org840b46d"><span class="section-number-4">1.4.3.</span> Org-Roam</h4><div class="outline-text-4" id="text-1-4-3"><p>This is still a work in progress. I'm transitioning (heh) to org-roam and am working on building this environment.</p><p>Binds are all declared later.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package org-roam :custom (org-roam-directory "~/org/roam") :config (org-roam-db-autosync-enable))</code></pre></div></div><ol class="org-ol"><li><a id="org6936cc1"></a>Org-Roam Capture Templates<br /><div class="outline-text-5" id="text-1-4-3-1"><p>I'm still working on these.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(setq org-roam-capture-templates '(("d" "default" plain "%?" :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("b" "book notes" plain "\n* Source\n\nAuthor: %^{Author}\nTitle: ${title}\nYear: %^{Year}\n\n* Summary\n\n%?" :if-new (file+head "book-notes/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("l" "linux notes" plain "\n* %^{Subject}\n\n%?" :if-new (file+head "linux-notes/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unarrowed t) ))</code></pre></div></div></li></ol></div></div><div id="outline-container-org144c9d4" class="outline-3"><h3 id="org144c9d4"><span class="section-number-3">1.5.</span> User Interface</h3><div class="outline-text-3" id="text-1-5"></div><div id="outline-container-orge8cc8d7" class="outline-4"><h4 id="orge8cc8d7"><span class="section-number-4">1.5.1.</span> Simple Tweaks</h4><div class="outline-text-4" id="text-1-5-1"><p>This is all simple tweaks and stuff that I prefer. </p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(global-set-key (kbd "<escape>") 'keyboard-escape-quit) ;; makes ESC a global quit;; hides and tweaks UI elements(scroll-bar-mode -1)(tool-bar-mode -1)(menu-bar-mode -1)(tooltip-mode -1)(set-fringe-mode 20)(setq use-dialog-box nil);; enables non-destructive word-wrap globally(global-visual-line-mode)(global-word-wrap-whitespace-mode t)(global-hl-line-mode);(setq inhibit-startup-message t)(setq sentence-end-double-space nil)(setq save-interprogram-paste-before-kill t)(setq shell-file-name "/bin/fish" sh-shell "/bin/fish")(setq help-window-select t) ;; switch to help buffer on open(setq recentf-mode t)(setq scroll-margin 5)</code></pre></div></div></div><div id="outline-container-org3610628" class="outline-4"><h4 id="org3610628"><span class="section-number-4">1.5.2.</span> Line Numbers</h4><div class="outline-text-4" id="text-1-5-2"><p>Enable lines numbers globally, then disables them for certain modes. Easier to do it that way than having to add a hook if I ever add new modes I want line numbers in. </p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(global-display-line-numbers-mode t)(dolist (mode '(org-mode-hook term-mode-hook eshell-mode-hook)) (add-hook mode (lambda () (display-line-numbers-mode 0))))</code></pre></div></div></div><div id="outline-container-org08d9f43" class="outline-4"><h4 id="org08d9f43"><span class="section-number-4">1.5.3.</span> Theme</h4><div class="outline-text-4" id="text-1-5-3"><p>Yeah, it's catppuccin. I'm basic.</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(use-package catppuccin-theme :custom (catppuccin-flavor 'macchiato))(load-theme 'catppuccin t)</code></pre></div></div></div><div id="outline-container-org0311bc3" class="outline-4"><h4 id="org0311bc3"><span class="section-number-4">1.5.4.</span> Fonts and related</h4><div class="outline-text-4" id="text-1-5-4"><p>Set font to Fira Mono. Install all-the-icons (if not found)</p><p>TODO: Do I need different settings for laptop vs desktop?</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(set-face-attribute 'default nil :font "Fira Mono" :height 110)(set-face-attribute 'variable-pitch nil :font "Fira Sans" :height 110)(use-package all-the-icons :if (display-graphic-p) :init (unless (find-font (font-spec :name "all-the-icons")) (all-the-icons-install-fonts t)))(use-package all-the-icons-dired :if (display-graphic-p) :hook (dired-mode . all-the-icons-dired-mode))(use-package all-the-icons-completion :if (display-graphic-p) :init (all-the-icons-completion-mode) :hook (marginalia-mode . all-the-icons-completion-marginalia-setup))</code></pre></div></div></div></div><div id="outline-container-org62591db" class="outline-3"><h3 id="org62591db"><span class="section-number-3">1.6.</span> Binds</h3><div class="outline-text-3" id="text-1-6"></div><div id="outline-container-orgf6067a0" class="outline-4"><h4 id="orgf6067a0"><span class="section-number-4">1.6.1.</span> Space as Leader and submenus</h4><div class="outline-text-4" id="text-1-6-1"><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(general-create-definer mei/leader-keys :keymaps '(normal insert visual emacs) :prefix "SPC" :global-prefix "M-SPC")(mei/leader-keys "f" '(:ignore f :which-key "file") "fs" '(save-buffer :which-key "save buffer") "ff" '(find-file :which-key "open file") "fr" '(consult-recent-file :which-key "recent file") "b" '(:ignore b :which-key "buffer") "bb" '(consult-buffer :which-key "switch buffer") "bk" '(kill-current-buffer :which-key "kill buffer") "bl" '(evil-switch-to-windows-last-buffer :which-key "last buffer") "bz" '(bury-buffer :which-key "bury buffer") "bx" '(scratch-buffer :which-key "scratch buffer") "s" '(:ignore s :which-key "search") "sb" '(swiper :which-key "search buffer") "sm" '(bookmark-jump :which-key "jump to bookmark") "sM" '(bookmark-set :which-key "set a bookmark") "e" '(:ignore e :which-key "eval") "e;" '(eval-expression :which-key "expression") "ee" '(eval-last-sexp :which-key "eval last expression") "eb" '(eval-buffer :which-key "eval buffer") "q" '(:ignore q :which-key "quit and session") "qq" '(save-buffers-kill-terminal :which-key "quit emacs") "h" '(:ignore h :which-key "help") "hf" '(describe-function :which-key "describe function") "hk" '(describe-key-briefly :which-key "describe key briefly") "hK" '(describe-key :which-key "describe key full") "hv" '(describe-variable :which-key "describe variable") "c" '(:ignore c :which-key "comments") "cr" '(comment-or-uncomment-region :which-key "comment region") "cl" '(comment-line :which-key "comment line") "w" '(:ignore w :which-key "window") "wq" '(evil-quit :which-key "evil-quit") "wT" '(tear-off-window :which-key "tear off window") "wo" '(evil-window-up :which-key "move up a window") "g" '(magit-status :which-key "magit") "r" '(:ignore r :which-key "org-roam") "r i" '(org-roam-node-insert :which-key "insert org-roam node") "r f" '(org-roam-node-find :which-key "find org-roam node") "r l" '(org-roam-buffer-toggle :which-key "toggle org-roam buffer") "t" '(:ignore t :which-key "toggle") "t v" '(mei/variable-toggle :which-key "variable-pitch mode") ) </code></pre></div></div></div><div id="outline-container-orga7e2ad4" class="outline-4"><h4 id="orga7e2ad4"><span class="section-number-4">1.6.2.</span> Global Keybinds</h4><div class="outline-text-4" id="text-1-6-2"><p>These are keybinds I want to work no matter what mode I'm in. As such, they're sparsely used. </p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(general-define-key :keymaps 'global "M-y" 'consult-yank-pop ;; paste (text) "M-Y" 'yank-media ;; paste (media) "M-w" 'kill-ring-save ;; copy "M-W" 'kill-region ;; cut (selection) "<f2>" 'hydra-text-scale/body "<f3>" 'vterm-toggle-cd "C-x <deletechar>" 'kill-sentence)</code></pre></div></div></div><div id="outline-container-org15754b2" class="outline-4"><h4 id="org15754b2"><span class="section-number-4">1.6.3.</span> Other Keybinds</h4><div class="outline-text-4" id="text-1-6-3"><p>This is probably some kind of heresy, but I just can't do the hjkl movement. My fingers are too trained to seek out a WASD shape. evil-open-below has been moved to M-o since it's still useful.</p><p>My brain is too hardwired to have undo/redo on anything but C-z/y.</p><p>A bunch of other minor changes for navigation. </p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(general-define-key :states 'normal "o" 'evil-previous-visual-line "k" 'evil-backward-char ";" 'evil-forward-char "l" 'evil-next-visual-line "C-_" 'evil-emacs-state "M-o" 'evil-open-below)(general-define-key :states '(normal insert) "C-z" 'evil-undo "C-y" 'evil-redo "C-e" 'evil-forward-sentence-begin)</code></pre></div></div></div></div><div id="outline-container-org03fd702" class="outline-3"><h3 id="org03fd702"><span class="section-number-3">1.7.</span> Functions</h3><div class="outline-text-3" id="text-1-7"></div><div id="outline-container-org9a20649" class="outline-4"><h4 id="org9a20649"><span class="section-number-4">1.7.1.</span> Tangle on Save</h4><div class="outline-text-4" id="text-1-7-1"><p>I found this function from Emacs-From-Scratch. You have to manually tangle yourself the first time to get the function into your init.el. Once it's loaded then everytime you save this file, it will auto-tangle to the destinations. </p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(defun efs/org-babel-tangle-config () (when (string-equal (buffer-file-name) (expand-file-name "~/emacs-forge/clean-init.org")) ;; Dynamic scoping to the rescue (org-babel-tangle)))(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'efs/org-babel-tangle-config)))</code></pre></div></div></div><div id="outline-container-orgb8435d8" class="outline-4"><h4 id="orgb8435d8"><span class="section-number-4">1.7.2.</span> Variable-pitch-mode toggle</h4><div class="outline-text-4" id="text-1-7-2"><p>Not sure if checking buffer-face-mode is the right call here, but I don't know where else variable-pitch-mode is listed as on/off</p><div class="org-src-container"><pre class="src src-emacs-lisp"><code>(defun mei/variable-toggle () "Toggle variable-pitch-mode" (interactive) (if (bound-and-true-p buffer-face-mode) ;; if buffer-face-mode is bound and true (variable-pitch-mode -1) ;; turn variable-pitch-mode off (variable-pitch-mode t))) ;; otherwise turn it on</code></pre></div></div></div></div></div></div><div id="postamble" class="status"><p class="author">Author: panda</p><p class="date">Created: 2025-11-10 Mon 12:23</p><p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p></div></body></html>