Open-Source Wikis

/

Neovim

/

Fun facts

neovim/neovim

Fun facts

A few amusing artifacts hidden in the Neovim tree.

The longest file

src/nvim/regexp.c is 456 KB and 16,309 lines. It contains two regular-expression engines — the legacy backtracker and the NFA-based one — both inherited from Vim and both still in use, picked at runtime by the re option. If you ever wondered why search performance has so many footguns, this file is why.

The biggest "data" file

src/nvim/options.lua is 450 KB. It is not generated; it is the human-edited source of truth for every Vim option. The C side (option.c, optionstr.c, option_vars.h) is generated from it by src/gen/gen_options.lua. Same pattern for ex_cmds.lua (84 KB) and eval.lua (510 KB — but that one is mostly machine-readable function metadata).

The first commit

2014-01-31 10:39:15 -0300Import vim from changeset v5628:c9cad40b4181. Neovim's "year zero" is a single squashed import of every Vim file as it stood at that revision. The next two days are commits like "Remove more #ifdef dead code", which set the tone for the whole project.

TODOs

There are roughly 402 TODO, FIXME, HACK, and XXX comments across all *.c files in src/nvim/. Many of them are tagged with the contributor's initials and a date — // TODO(zeertzjq): ... — making them easy to grep when you're hunting for a specific maintainer's intentions.

"vim-patch" commits

Run git log --grep "^vim-patch:" --oneline | wc -l and you get a five-digit number. Roughly 25–30% of all commits are vim-patch: ports of upstream Vim changes, executed by maintainers who have memorized the workflow in runtime/doc/dev_vimpatch.txt. The script that drives the workflow is scripts/vim-patch.sh.

Vendored terminal emulator

src/nvim/vterm/ is an in-tree fork of libvterm. It is the only third-party C dependency that Neovim "owns" outright — the upstream is no longer tracked. The :terminal command, the embedded REPLs, and vim.system()'s pty mode all run through this vendored emulator.

The marktree

src/nvim/marktree.c is 75 KB and implements a B+-tree from scratch to make extmarks O(log n) under buffer changes. The B+-tree literature is dense; the file makes a serious effort to be self-documenting, but you should still expect to spend a couple of hours with it the first time. It is one of the few subsystems where reading the code alone is faster than reading the design doc, because there isn't one.

"Justin made me do it"

The .git-blame-ignore-revs file at the repo root lists commits that should be skipped by git blame because they are pure formatting/refactoring churn. Setting git config blame.ignoreRevsFile .git-blame-ignore-revs is on the contributing checklist — without it, git blame for nearly any file in src/nvim/ will return a single huge whitespace commit instead of the actual author of a line.

Two interpreters in one binary

Neovim links two Lua interpreters: LuaJIT (the default) and PUC Lua (used in tests for the lua-5.1 reference implementation). The build picks LuaJIT unless you pass -DPREFER_LUA=ON; the harness in test/ can run against either. There is also a tiny nlua0 interpreter (src/nlua0.c, src/nlua0.zig) used by build-time code generation.

Three build systems

The repo is built with CMake (the canonical path). It also has a build.zig (31 KB) for an experimental Zig build path, and a top-level Makefile whose only job is to translate human-friendly targets into CMake invocations. BSDmakefile exists so that make on a BSD without GNU make at least prints a useful error.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Fun facts – Neovim wiki | Factory