Skip to content
Sunil Murthy edited this page Aug 22, 2025 · 2 revisions

Emacs Configuration

XDG-compliant Emacs configuration with modern package management and sensible defaults.

Features

  • XDG Base Directory Specification compliance
  • Modular configuration structure
  • Package management with MELPA
  • Sensible defaults for development
  • Clean separation of config, data, and cache files

XDG Compliance

This configuration is fully XDG compliant:

  • Config: ~/.config/emacs/ - Configuration files
  • Data: ~/.local/share/emacs/ - User data (packages, history, bookmarks)
  • Cache: ~/.cache/emacs/ - Temporary and cache files

Installation

make emacs
# or directly with stow
cd packages/editors && stow emacs -t ~

Configuration Structure

.config/emacs/
├── init.el              # Main entry point
├── base/                # Core configuration modules
│   ├── base-xdg.el     # XDG compliance setup
│   ├── base-init.el    # Base initialization
│   ├── base-packages.el # Package management
│   └── ...
├── packages/           # Package-specific configurations
├── themes/            # Theme configurations
├── user/              # User-specific settings
└── vendor/            # Third-party packages

Key Bindings Reference

M- Meta key (ALT/ESC)
C- Control key (CTRL)
S- Shift key

Essential Commands

  • C-x C-f - Find file
  • C-x C-s - Save file
  • C-x C-c - Exit Emacs
  • C-g - Cancel command
  • M-x - Execute command

Code Navigation

Built-in Features

  • M-. - Jump to definition
  • M-, - Jump back
  • C-x r m - Set bookmark
  • C-x r b - Jump to bookmark

Enhanced Navigation

  • ctags / ggtags for code browsing
  • LSP support for modern language servers
  • Project management with built-in project.el

Migration from ~/.emacs.d

If you have an existing ~/.emacs.d setup, the configuration includes migration support to move your data to XDG-compliant locations.

Dependencies

  • Emacs 27.1 or later
  • Internet connection for package installation

Customization

Edit user/user-setup.el to customize user-specific settings like name and email. The configuration automatically installs essential packages from MELPA on first run.

Clone this wiki locally