Literate Configuration with Emacs

Background I’m spending most of my long vacation reorganizing my github repositories, archiving some old repos (mostly android stuffs that I don’t use anymore). And when I’m looking into my dotfiles repos I remember once I’ve tried to use literate programming to manage them. I think one of the difficulties I had was editing the source code block inline. 1 2 3 4 This is how shell code block looks like in /Emacs/ #+begin_src sh echo true #+end_src Editing code blocks inline has many disadvantages, for one, indentation is quite tricky. You’ll never know the whitespaces until you tangled them. I’m sure there are solutions for this problems, but for now I just org-edit-special (bound to C-c '). ...

March 12, 2024 · (updated August 9, 2025) · 2 min · 417 words · Kristian Alexander P

Hugo blog org-capture-templates

Blogging with org-mode I do almost all my note-taking in Emacs org-mode, so naturally I also prefer to write my blog posts in it. As for my ox-hugo blogging flow, I use the less preferred method: one org file per post, the consequence is I cannot just copy-paste the org capture setup provided by the doc site. I also setup my posts in a subdirectory beneath the HUGO_BASE_DIR: 1 tree -n .. Code Snippet 1: my content directory 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 .. ├── about │ └── about.org ├── archives.org ├── configuring-neovim │ └── configuring-neovim.org ├── emacs-avy │ ├── avy.gif │ └── emacs-avy.org ├── emacs-builtin-use-package │ ├── emacs-builtin-use-package.org │ ├── prefix-key.png │ └── which-key-mode.png ├── emacs-debian-wsl │ ├── Emacs-WSL.png │ ├── WSL-2025-07-25 231457.png │ └── emacs-debian-wsl.org ├── emacs-evil │ └── emacs-evil.org ├── emacs-general │ └── emacs-general.org ├── emacs-sane-defaults │ ├── default-emacs.png │ ├── emacs-after.png │ ├── emacs-dired.png │ ├── emacs-eshell.png │ ├── emacs-sane-defaults.org │ └── emacs-tetris.png ├── emacs-shell │ ├── emacs-shell.org │ ├── eshell-command-form.png │ ├── eshell-elisp-form.png │ └── eshell.png ├── emacs-version-control │ ├── emacs-magit-status.png │ └── emacs-version-control.org ├── emacs-vertico │ ├── consult-buffer.png │ ├── consult-flymake.png │ ├── consult-outline.png │ ├── consult-yank-pop.png │ ├── corfu-completion.png │ ├── emacs-vertico.org │ ├── emacs-vertico.png │ ├── emacs-without-vertico.png │ ├── marginalia-describe-variable.png │ ├── marginalia-files.png │ ├── marginalia-find-file-with-icons.png │ ├── nerd-icons-corfu.png │ ├── orderless-default.png │ ├── vertico-buffer-mode.png │ ├── vertico-flat-mode.png │ ├── vertico-grid-mode.png │ ├── vertico-indexed-mode.png │ ├── vertico-quick.png │ └── vertico-reverse-mode.png ├── github-action-hugo-emacs │ ├── action-secrets-and-variables.png │ ├── deploy-github.png │ └── github-action-hugo-emacs.org ├── hugo-blogging-org-capture-templates │ ├── hugo-blogging-org-capture-templates.org │ └── transient.png ├── hyprland │ ├── applications.gif │ ├── hyprland.org │ └── hyprland.png ├── i3wm │ ├── i3wm-2025-06-23 23:42:18.gif │ ├── i3wm-2025-06-23_22-28.png │ ├── i3wm-dependency-2025-06-24_00-05.png │ ├── i3wm-scratch-2025-06-23 22-53.gif │ └── i3wm.org ├── learning-how-to-learn00 │ └── learning-how-to-learn00.org ├── learning-rust │ ├── learning-rust.org │ └── rust-perfect-number.png ├── literate-configuration │ ├── github-pages-deployed.png │ ├── literate-configuration.org │ ├── literate-emacs-screenshot.png │ └── org-edit-special.png ├── marks-and-registers-in-emacs │ └── marks-and-registers-in-emacs.org ├── modular-guix-system-configuration │ ├── EFI-partition.png │ ├── TRAMP.png │ ├── btrfs-subvolumes.png │ ├── cow-store.png │ ├── filesystem.png │ ├── linux-partition.png │ ├── modular-guix-system-configuration.org │ ├── mount-btrfs.png │ ├── mounting-subvolumes.png │ └── swapfile-creation.png ├── notmuch-mail-emacs │ ├── full.png │ └── notmuch-mail-emacs.org ├── org-mode-workflow │ ├── emacs-dashboard.png │ ├── org-agenda-custom-commands-upcoming.png │ ├── org-agenda-custom-commands-work.png │ ├── org-agenda-custom-incomplete.png │ ├── org-agenda-custom-next-three-days.png │ ├── org-agenda-custom-today.png │ ├── org-capture-1.png │ ├── org-capture-2.png │ ├── org-capture-firefox.png │ ├── org-capture-with-template-1.png │ ├── org-capture-with-template-2.png │ ├── org-capture-with-template-3.png │ ├── org-capture-with-template-4.png │ ├── org-mode-workflow.org │ ├── org-modern-agenda.png │ ├── org-modern.png │ ├── org-protocol-capture-firefox.png │ ├── task-flow.svg │ └── vanilla-emacs-org-agenda.png ├── projects │ └── projects.org ├── search.org ├── shell-tips-and-tricks │ └── shell-tips-and-tricks.org ├── syncthing-is-underrated │ ├── syncthing-is-underrated.org │ └── syncthing-web-2025-06-27_00-11.png ├── terminal-multiplexer │ ├── gnu-screen-2.png │ ├── gnu-screen.png │ └── terminal-multiplexer.org ├── theming-emacs │ ├── default-emacs.png │ ├── emacs-doom-theme-modeline-and-dashboard.png │ ├── emacs-wombat.png │ └── theming-emacs.org └── why-use-mpd ├── cantata-2025-06-26_22-54.png ├── mpc-2025-06-26_23-41.png ├── ncmpcpp-2025-06-26_22-44.png └── why-use-mpd.org 29 directories, 112 files Custom org-capture-templates First off, org-capture-templates is just like its name; it is a template for creation of new entries. It is used by org-mode, which is a killer feature of Emacs. Initially it was design to capture notes with little interruption1. But since it was all Emacs Lisp, we can modify it with ease. ...

March 3, 2024 · (updated August 9, 2025) · 12 min · 2401 words · Kristian Alexander P

Emacs Version Control

Magit Magit is a complete text-based user interface to Git. It fills the glaring gap between the Git command-line interface and various GUIs, letting you perform trivial as well as elaborate version control tasks with just a couple of mnemonic key presses. Magit looks like a prettified version of what you get after running a few Git commands but in Magit every bit of visible information is also actionable to an extent that goes far beyond what any Git GUI provides and it takes care of automatically refreshing this output when it becomes outdated. In the background Magit just runs Git commands and if you wish you can see what exactly is being run, making it possible for you to learn the git command-line by using Magit1. ...

February 29, 2024 · (updated August 9, 2025) · 7 min · 1396 words · Kristian Alexander P

Emacs shell

Eshell It is a shell written in Emacs Lisp. Eshell is both a command shell and an Emacs Lisp REPL (Read Eval Print Loop), as a result, you can invoke commands in two different ways: command form or in Lisp form. As always, the official documentation provides you with more than enough information on Eshell. Figure 1: Eshell Command form Command form looks much the same as in other shells. A command consists of arguments separated by spaces; the first argument is the command to run, with any subsequent arguments being passed to that command. ...

February 28, 2024 · (updated August 9, 2025) · 2 min · 241 words · Kristian Alexander P

Theming Emacs

Why? Figure 1: Default Emacs UI For those who prefer a universal theme in their destop, the default Emacs interface is kind of ugly. Though there are built-in themes included, to be fair the options are limited. Figure 2: emacs wombat theme, one of the better ones Doom When I first tried Emacs, Doomemacs was my first choice. It’s kind of a “curated default configurations”. ...

February 27, 2024 · (updated August 9, 2025) · 2 min · 268 words · Kristian Alexander P

Emacs Evil

Evil is an extensible vi layer for Emacs. It emulates the main features of Vim, and provides facilities for writing custom extensions. Installing Add Melpa 1 2 (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) Code Snippet 1: melpa with use-package 1 2 3 4 5 6 7 8 9 10 11 12 13 14 (use-package evil :ensure :preface (customize-set-variable 'evil-want-keybinding nil) ;; if using `evil-collection' (customize-set-variable 'evil-want-integration t) ;; if using `evil-collection' (customize-set-variable 'evil-undo-system 'undo-redo) (customize-set-variable 'evil-want-C-u-scroll t) ;; move universal arg to <leader> u (customize-set-variable 'evil-want-C-u-delete t) ;; delete back to indentation in insert state (customize-set-variable 'evil-want-C-g-bindings t) :config (evil-mode 1) ;; disable this when using `general.el' (evil-set-leader '(normal visual) (kbd "SPC")) (evil-set-leader '(normal visual) (kbd "C-c SPC") t)) Code Snippet 2: use-package without use-package 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ;; Set up package.el to work with MELPA (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) (package-refresh-contents) ;; Download Evil (unless (package-installed-p 'evil) (package-install 'evil)) ;; Enable Evil (require 'evil) (evil-mode 1) Code Snippet 3: without use-package Configuration Leader and Localleader key This is inherited from vim1, So this isn’t really required, but as someone who use both vim and Emacs it certainly easier to memorize. ...

February 25, 2024 · (updated August 9, 2025) · 3 min · 500 words · Kristian Alexander P

Emacs general.el

About general.el provides a more convenient method for binding keys in emacs (for both evil and non-evil users). Like use-package, which provides a convenient, unified interface for managing packages, general.el is intended to provide a convenient, unified interface for key definitions. While this package does implement some completely new functionality (such as the ability to make vim-style keybindings under non-prefix keys with an optional timeout), its primary purpose is to build on existing functionality to make key definition more clear and concise. general-define-key is user-extensible and supports defining multiple keys in multiple keymaps at once, implicitly wrapping key strings with (kbd ...), using named prefix key sequences (like the leader key in vim), and much more1. ...

February 24, 2024 · (updated August 9, 2025) · 3 min · 612 words · Kristian Alexander P

Emacs sane defaults

Figure 1: Default Emacs The default Emacs is kinda boring and unintuitive, if you’re looking for a simple text editor, I really suggest other editors like nano, vim, or other graphical editors like gedit. The main advantage of using Emacs is that in can be more than just a text editor. Figure 2: Tetris inside Emacs I don’t think anybody ever want to play tetris inside Emacs, but it’s there! ...

February 23, 2024 · (updated August 9, 2025) · 5 min · 941 words · Kristian Alexander P

Emacs vertico

Vertico provides a performant and minimalistic vertical completion UI based on the default completion system. The focus of Vertico is to provide a UI which behaves correctly under all circumstances. By reusing the built-in facilities system, Vertico achieves full compatibility with built-in Emacs completion commands and completion tables. Vertico only provides the completion UI but aims to be highly flexible, extendable and modular. Additional enhancements are available as extensions or complementary packages. The code base is small and maintainable. The main vertico.el package is only about 600 lines of code without white space and comments1. ...

February 23, 2024 · (updated August 9, 2025) · 13 min · 2735 words · Kristian Alexander P

Emacs avy

This is a series of post about external Emacs packages that I use. Avy avy is a GNU Emacs package for jumping to visible text using a char-based decision tree. installing with use-package 1 2 3 4 5 6 7 (use-package avy :ensure ;; when `use-package-always-ensure' is nil :bind (("C-:" . avy-goto-char) ("C-'" . avy-goto-char2) ("M-g f" . avy-goto-line) ("M-g w" . avy-goto-word-1) ("M-g e" . avy-goto-word-0))) Notes: for evil user, theres a command evil-avy-goto*. for evil user 1 2 3 4 5 6 7 (use-package avy :after evil :ensure ;; when `use-package-always-ensure' is nil :bind (([remap goto-char] . evil-avy-goto-char) ([remap goto-line] . evil-avy-goto-line) ("M-g l" . evil-avy-goto-line)))

February 22, 2024 · (updated August 9, 2025) · 1 min · 108 words · Kristian Alexander P