A New Contender in the Editor Landscape

The open‑source community has long been dominated by heavyweight IDEs and feature‑rich editors like VS Code and Sublime Text. In contrast, the NVI Editor, whose documentation is now available on Git SR HT, positions itself as a minimalist alternative that prioritizes speed and low resource consumption.

"NVI is not about replacing your existing tools; it’s about providing a lightweight companion for quick edits and scripting tasks." – Lead developer of NVI, documented in the guide.

Core Philosophy

The guide outlines three guiding principles:

  1. Simplicity – A single‑pane interface, no modal dialogs, and a focus on the editor window itself.
  2. Extensibility – A plugin system based on Lua scripts that can be added or removed on the fly.
  3. Performance – Built with C++ and compiled with minimal dependencies, the editor boots in under 200 ms on modern hardware.

These goals are reflected in the file structure and the minimal set of bundled features: syntax highlighting, line numbers, and basic file navigation.

Feature Highlights

Feature Description Customization
Syntax Highlighting Supports over 30 languages out of the box, using a lightweight lexer. Users can add new lexers via Lua scripts.
Plugin System Plugins are Lua modules that expose hooks such as onOpen, onSave, and onKeyPress. The guide provides a template for creating a "Auto‑Formatter" plugin.
Terminal Integration A built‑in terminal can be toggled with Ctrl‑~, allowing quick command execution without leaving the editor. Terminal behavior can be configured through a JSON file.
Git Integration Basic diff and status commands are available via the command palette. Advanced Git workflows can be scripted with Lua.

Example: Building a Simple Plugin

The guide walks readers through creating a plugin that automatically formats Python files on save. The Lua script looks like this:

-- auto_format.lua
function onSave(filePath)
    if filePath:match("%.py$") then
        os.execute('black ' .. filePath)
        print('Formatted ' .. filePath)
    end
end

After placing the file in the plugins/ directory and restarting NVI, the developer will see the formatter run each time a Python file is saved.

Community and Future Roadmap

The documentation includes a roadmap that highlights upcoming features such as:

  • Multi‑cursor support – allowing simultaneous edits across the file.
  • Remote editing – connecting to a server via SSH for editing files directly on a VM.
  • Theme engine – a collection of color schemes that can be toggled with a single command.

The project is hosted on Git SR HT, and contributions are welcomed through pull requests. The guide encourages developers to report issues via the built‑in bug tracker.

Why It Matters

While many developers already rely on powerful IDEs, the need for a quick, distraction‑free editor remains. NVI’s emphasis on low latency and a plugin‑driven architecture makes it a compelling choice for:

  • Scripting and automation – where a lightweight interface speeds up iterative development.
  • Embedded systems – where resources are limited and a full IDE would be overkill.
  • Educational settings – where students can focus on code without being overwhelmed by UI complexity.

By offering a well‑documented, extensible platform, NVI could become the go‑to tool for developers who value speed and simplicity without sacrificing flexibility.

Source: https://git.sr.ht/~r1w1s1/code-notes/blob/main/notes/NVI_Editor_Guide.txt