@replit/codemirror-lang-nix
v6.0.1
Published
A Nix mode for CodeMirror 6
Downloads
178,584
Maintainers
Keywords
Readme
CodeMirror Nix Mode
A codemirror extension that adds Nix syntax highlighting and language features.
Usage
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { nix } from "@replit/codemirror-lang-nix";
import { basicSetup } from 'codemirror';
new EditorView({
state: EditorState.create({
doc: `{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell { buildInputs = [ pkgs.nodejs ]; }`,
extensions: [basicSetup, nix()],
}),
parent: document.querySelector('#editor'),
});