AGENTS.md 3.0 KB

Repository Guidelines

This repository stores Micro editor configuration. Keep changes lightweight, reproducible, and focused on editing ergonomics.

Repository Setup

  • Git is initialized locally in this directory and points at git@git.cere.ipv64.net:cere/config_micro.git.
  • Use conventional commits when recording changes and push to the remote once you have verified bindings.

Project Structure & Module Organization

  • bindings.json defines overrides: Alt-/, Ctrl+_, and Ctrl-q call the comment plugin, Ctrl-l runs DeleteLine, Ctrl-d spawns an extra cursor, Alt-d removes one, and Ctrl-w triggers Quit.
  • buffers/ holds Micro session history; treat the binary content as read-only runtime state.
  • backups/ powers Micro's auto-rescue flow—leave the directory present even when empty.

Build, Test, and Development Commands

  • micro bindings.json validates JSON syntax with native highlighting before committing.
  • micro scratch.txt is the quickest loop for binding checks—confirm comment toggles with Ctrl-q, line deletes with Ctrl-l, multi-cursor spawn/remove with Ctrl-d/Alt-d, and clean quits with Ctrl-w.
  • micro --plugin list verifies that required plugins (notably comment) load before bindings reference them.

Coding Style & Naming Conventions

  • Use four-space indentation, one mapping per line, and keep key combos sorted.
  • Prefer lower-case filenames for new config modules (e.g., settings.json, plugins.json).
  • Place experimental or generated files in subdirectories to keep the root readable.

Keybinding Lessons

  • If a default conflicts with a new shortcut, clear it using None before reassigning; this prevented the original Ctrl-q quit action from resurfacing.
  • Choose ergonomic remaps (Ctrl-w quit, Ctrl-l line delete, Ctrl-d spawn cursor, Alt-d remove cursor) that mirror terminal editor habits and document intent.
  • Reference runtime/help/keybindings.md upstream when drafting additional shortcuts.

Testing Guidelines

  • After changes, relaunch Micro and trigger each affected binding; comment toggles, line deletes, cursor spawn/remove, and quitting form the smoke test.
  • If a binding calls a plugin, install it first (micro --plugin install <name>) to prevent runtime errors.
  • Watch terminal output while testing; warnings usually point to typos in bindings.json.

Commit & Pull Request Guidelines

  • Follow Conventional Commits (feat:, fix:, chore:) to summarize configuration intent.
  • Record manual verification (“Verified Ctrl-q comment toggle, Ctrl-l delete, Ctrl-d/Alt-d multi-cursor cycle, and Ctrl-w quit in scratch buffer”) in commits or PRs.
  • PRs should list added or removed bindings and link any tracking issues for context.

Security & Configuration Tips

  • Never commit personal tokens or absolute machine paths—Micro reads configs directly from ~/.config/micro.
  • Test high-impact bindings on throwaway files before editing production documents to avoid accidental changes.