@replit/codemirror-lang-nix
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

CodeMirror Nix Mode

Run on Repl.it NPM version

A codemirror extension that adds Nix syntax highlighting and language features.

example of Nix syntax highlighting

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

Readme

Keywords

none

Package Sidebar

Install

npm i @replit/codemirror-lang-nix

Weekly Downloads

52,108

Version

6.0.1

License

MIT

Unpacked Size

337 kB

Total Files

25

Last publish

Collaborators

  • james-addison-replit
  • replitdstewart
  • ryanweingast
  • harryatreplit
  • theflowingsky
  • jonesit-replit
  • szymon_k
  • cdmistman
  • jackyzha0
  • jamesaustinreplit
  • lopezhoracio
  • bradymaddenreplit
  • ryantm
  • alexisreplit
  • ink404
  • brianpool
  • tobyho
  • brenoafb
  • masad-frost
  • lincolnreplit
  • stkenned
  • replitmatt
  • cbrewster
  • ltazmin_replit
  • moudy
  • schestakov
  • lhchavez
  • slmjkdbtl
  • lunaroyster