explaingit

martanne/vis

4,588CAudience · developerComplexity · 3/5Setup · easy

TLDR

Vis is a minimal terminal text editor that combines vi-style modal editing with structural regular expressions and multi-cursor editing, extensible via Lua scripts.

Mindmap

mindmap
  root((vis editor))
    What it does
      Terminal text editor
      Modal editing like vi
      Structural regex selection
      Multi-cursor editing
    Tech stack
      C source code
      Lua scripting
      LPeg grammar library
    Features
      Syntax highlighting
      Plugin API in Lua
      Minimal footprint
    Intentionally excluded
      No file browser
      No GUI
      No Vim scripting compat
    Audience
      Keyboard-driven developers
      Embedded Linux users
      Power users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Use vis as a lightweight, keyboard-driven terminal editor on resource-constrained systems like embedded Linux or remote servers with limited RAM.

USE CASE 2

Edit code in multiple places at once using vis's built-in multi-cursor support without needing a plugin.

USE CASE 3

Write Lua scripts to add custom syntax highlighting or editor behavior without modifying C source code.

USE CASE 4

Use structural regular expressions to select and transform text in expressive ways that go beyond standard find-and-replace.

Tech stack

CLuaLPeg

Getting it running

Difficulty · easy Time to first run · 5min

Available in most Linux package managers (apt, pacman, etc.), compile from source only if you need the latest version or are on an unusual system.

Check repository for license, available in most Linux distribution package managers, so no compilation required for basic use.

In plain English

Vis is a terminal-based text editor written in C. It takes inspiration from two older editors: vi (the classic modal editor that keyboard-driven developers know well) and sam (a research editor from Bell Labs that introduced a different way of describing text ranges). Vis borrows modal editing from vi, meaning you switch between a navigation mode and a typing mode rather than always inserting text directly, and it borrows sam's approach to finding and transforming text using what are called structural regular expressions. Structural regular expressions let you describe not just individual matches but the structure around them, which makes it possible to select and edit text in more expressive ways than a standard find-and-replace. Vis also supports multiple cursors at the same time, so you can edit several places in a file simultaneously. Syntax highlighting in vis is powered by Lua scripts using a grammar library called LPeg. This means the highlighting rules are written in a scripting language rather than baked into the editor's binary, and you can extend or replace them. There is also a Lua API for writing plugins that run inside the editor process itself. The editor is intentionally small. The README lists a long set of things it will not add: no built-in file browser, no tabs, no GUI, no network protocol support, no encryption, and no compatibility with Vim's scripting language. Clipboard handling and fuzzy file opening are expected to come from separate tools. The goal is a focused core that handles text editing well and can run on resource-constrained systems. Building it requires a C99 compiler and a POSIX-compatible environment, plus a few libraries. Most Linux distributions package it directly, so you may be able to install it without compiling from source. Documentation is available in a manual page and a project wiki.

Copy-paste prompts

Prompt 1
I want to write a Lua plugin for the vis text editor that automatically strips trailing whitespace from every line when I save a file. Show me the vis Lua API calls needed.
Prompt 2
Show me the vis structural regular expression syntax to select all lines that contain the word 'TODO' and delete them from a file.
Prompt 3
I want to add syntax highlighting for a custom file type in vis using LPeg. Show me a minimal Lua grammar file structure that colorizes keywords, strings, and comments.
Prompt 4
How do I configure vis to use an external fuzzy file finder like fzf for opening files? Show me the Lua config snippet and any shell glue needed.
Prompt 5
Explain how vis modal editing differs from Vim's, focusing on the sam-inspired text object model and how I would select a paragraph and replace its contents.
Open on GitHub → Explain another repo

← martanne on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.