Skip to content

A CodeMirror (v6) extension for adding relative line numbers to your code editor

License

Notifications You must be signed in to change notification settings

jsjoeio/codemirror-line-numbers-relative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relative Line Numbers for CM6

Installation

yarn add codemirror-line-numbers-relative

Usage

Edit cm6-relative-line-numbers-ts (with package)

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"),
});

Credit

This wouldn't be possible these resources:

About

A CodeMirror (v6) extension for adding relative line numbers to your code editor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published