yarn add codemirror-line-numbers-relative
import { EditorView } from "@codemirror/view";
import { EditorState } from "@codemirror/state";
import { lineNumbersRelative } from "codemirror-line-numbers-relative";
new EditorView({
state: EditorState.create({
doc: `hello world!
who doesn't love relative line numbers?`,
extensions: [lineNumbersRelative()],
}),
parent: document.querySelector("#editor"),
});
This wouldn't be possible these resources: