Emacs Configurations

Table of Contents

1. Introduction

This is my comprehensive Emacs configuration written in a literate programming style using Org-mode. The configuration is split into modular sections for better organization and maintainability.

1.1. How This Works

  • Tangling: Since configurations are modular, you can:
    • Run ./tangle.sh from the repository root (recommended - handles all files recursively)
    • Tangle individual files: Open a config file and run C-c C-v t
    • Use the Elisp helper: See "Tangling All Configurations" section below
  • Exporting: Use C-c C-e h h to export this document to HTML for publishing
  • Modular Structure: Configuration files are organized in configs/ with subdirectories:
    • Top-level files for core Emacs settings
    • programming/ for language-specific configurations
    • documentation/ for document format configurations (Org-mode, Markdown)

1.2. Quick Start

  1. Clone this repository
  2. Run ./tangle.sh from the repository root (recommended)
  3. Restart Emacs

Alternative methods:

  • From Emacs: Navigate to "Tangling All Configurations" section and execute the code block (C-c C-c)
  • Individual files: Open a config file and run C-c C-v t

1.3. File Structure

The configuration is organized as follows:

  • Early Init - Performance optimizations that must load before anything else
  • Init - Core Emacs settings and built-in packages
  • Theme - Visual appearance and mode line configuration
  • Window - Window management and layout
  • Completion - Completion frameworks and interfaces
  • Dired - Directory editor enhancements
  • Documentation - Modular documentation system (Org-mode, Markdown)
    • General documentation tools
    • Org-mode configurations
    • Markdown configurations
  • Shell - Terminal and shell integration
  • Programming - Modular language-specific configurations
    • General programming tools
    • Web development (HTML/CSS/JS/TypeScript)
    • Python development
    • Ruby development
  • Miscellaneous - Utilities and helper functions
  • Platform-Specific - OS-specific configurations

2. Tangling All Configurations

2.1. Using tangle.sh (Recommended)

The repository includes a tangle.sh script that automatically finds and tangles all configuration files recursively:

./tangle.sh

This script:

  • Recursively processes all .org files in content/emacs/configs/
  • Includes subdirectories (programming/, documentation/)
  • Creates required directories (~/.emacs.d/elisp/)
  • Shows progress for each file

2.2. Using Elisp Helper (Alternative)

Alternatively, execute this code block from within Emacs by placing your cursor inside it and running C-c C-c:

(let ((default-directory (file-name-directory (buffer-file-name)))
      (config-files '("configs/01-early-init.org"
                      "configs/02-init.org"
                      "configs/03-theme.org"
                      "configs/04-window.org"
                      "configs/05-completion.org"
                      "configs/06-dired.org"
                      "configs/07-docs.org"
                      "configs/documentation/00-loader.org"
                      "configs/documentation/01-general.org"
                      "configs/documentation/02-org.org"
                      "configs/documentation/03-md.org"
                      "configs/08-shell.org"
                      "configs/09-programming.org"
                      "configs/programming/00-loader.org"
                      "configs/programming/01-general.org"
                      "configs/programming/02-web.org"
                      "configs/programming/03-python.org"
                      "configs/programming/04-ruby.org"
                      "configs/10-miscellaneous.org"
                      "configs/11-platform-linux.org"
                      "configs/12-platform-macos.org"
                      "configs/13-platform-windows.org")))
  (dolist (file config-files)
    (let ((filepath (expand-file-name file)))
      (when (file-exists-p filepath)
        (message "Tangling %s..." file)
        (org-babel-tangle-file filepath))))
  (message "All configurations tangled successfully!"))

This will process all config files and extract their code blocks to ~/.emacs.d/.

3. Configuration Sections

3.7. Documentation (Org-mode & Markdown)

3.7.1. Documentation Modules

The documentation configuration is modular and includes:

  • Loader - Orchestrates all documentation configs
  • General - Common documentation tools (olivetti, etc.)
  • Org-mode - Org-mode specific configurations
  • Markdown - Markdown mode configurations

3.9. Programming Languages

3.9.1. Programming Modules

The programming configuration is modular and includes:

  • Loader - Orchestrates all programming configs
  • General - Common programming tools (LSP, Magit, etc.)
  • Web Development - HTML, CSS, JavaScript, TypeScript
  • Python - Python development environment
  • Ruby - Ruby development environment

3.11. Platform-Specific Configurations