An editor as a dataset
The same key can mean something completely different in Neovim’s normal and insert modes. That made editor activity an interesting question for a machine learning project: could a Transformer learn what comes next from the recent sequence and its context?
This project grew out of Machine Learning II at Utah Valley University.
From keystrokes to predictions
The pipeline starts with events collected inside Neovim. FastAPI receives them, SQLite stores them, and Python prepares the sequences for a PyTorch model. Roughly 500,000 events were collected over five to six weeks.
Alongside each key, the data includes editor mode, file type, cursor position, and timing. Categorical features are tokenized; numeric features are normalized before training on sequences of 64 events.
What the examples showed
The documented examples suggest the model picked up useful context: navigation keys in normal mode, and the next letter of a word in insert mode. Editor mode appears to be a useful signal for prediction.
What stayed with me
The data pipeline matters as much as the model. Cleaning missing values early and carrying the same token mappings and normalization into inference were central lessons. Syntax-aware context is a possible next direction.