Added comprehensive documentation for Claude Code instances working with this Emacs configuration, including: - Core commands for configuration management and emergency fixes - High-level architecture overview and module organization - Key operational notes about CUA mode, completion system, and keybindings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
4.0 KiB
4.0 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a modular Emacs configuration with 33+ configuration modules in the lisp/ directory. The configuration is designed for software development with support for multiple languages, LSP, version control, and various productivity tools.
Core Commands
Configuration Management
M-x reload-emacs-config ; Reload entire configuration
M-x byte-compile-config ; Byte-compile all config files for faster loading
M-x clean-byte-compiled-files ; Remove all .elc files
M-x byte-compile-init-files ; Compile only lisp/ directory files
Emergency Fixes
M-x fix-editing-now ; Emergency restore editing capability
M-x diagnose-editing-issue ; Diagnose why editing is disabled
M-x diagnose-cua-selection ; Debug CUA mode and selection issues
M-x diagnose-key-conflicts ; Debug keybinding conflicts
C-c C-! ; Quick emergency fix keybinding
C-c C-? ; Quick diagnosis keybinding
Package Management
M-x package-refresh-without-proxy ; Refresh packages bypassing proxy
M-x package-install-without-proxy ; Install package bypassing proxy
M-x install-dev-packages ; Install common development packages
M-x toggle-proxy ; Toggle proxy settings on/off
Development Modes
M-x enable-dev-mode-modern ; Enable Eglot-based development mode
M-x enable-dev-mode ; Enable LSP-mode based development (legacy)
M-x disable-eslint-in-buffer ; Disable ESLint in current buffer
Architecture
Module Loading Order (init.el)
- Emergency fixes (
init-emergency-fix) - Loaded first to ensure editing works - Core modules - Package management, completion, UI, editor settings
- Development tools - Project management, VCS, LSP, treesitter
- Optional configs - Loaded conditionally if files exist
Key Configuration Modules
Core System:
init-core.el- Package management with use-packageinit-completion.el- Company mode for auto-completion (replaced Corfu)init-ui.el- CUA mode configuration, themes, display settingsinit-editor.el- Selection keybindings, shift-selection fixes
Development:
init-eglot.el- Built-in LSP client configurationinit-treesitter.el- Tree-sitter support for Emacs 29+emacs-dev-config-modern.el- Modern development setup with Eglotemacs-dev-config.el- Legacy LSP-mode configuration
Fix Modules:
init-emergency-fix.el- Emergency editing restorationinit-eslint-fix.el- ESLint configuration handlinginit-seq-fix.el- Seq library compatibility fixes
Applications:
elfeed-config.el- RSS reader with CUA mode fixesportfolio-tracker-v2.el- Investment portfolio trackingmu4e-config.el- Email client configuration
CUA Mode and Keybinding Architecture
The configuration uses CUA mode for standard copy/paste (C-c, C-v, C-x) but disables it in special modes where single-key commands are needed:
- Elfeed buffers
- Magit
- Dired
- Portfolio tracker
C-Shift-Arrow word selection is specially configured to work with CUA mode through custom functions in init-editor.el.
Completion System
Uses Company mode with:
- Auto-completion after 2 characters
- 0.2 second delay
- Tab/Shift-Tab navigation
- Multiple backends configured
Custom Keybindings
C-c C-r- Reload configurationC-c C-d c- Diagnose CUA/selectionC-c C-d k- Diagnose key conflictsC-x w- Open Elfeed RSS readerC-c $- Open portfolio tracker
Important Notes
- The configuration automatically disables CUA mode in special modes to preserve single-key commands
- ESLint is automatically disabled if no configuration file is found in the project
- Proxy settings can be toggled for package installation (default: eudewerepo001:3128)
- Byte-compilation is recommended for faster startup (
M-x byte-compile-config) - Emergency fix functions are available if editing becomes disabled