Skip to content

An Emacs major mode for editing Nix expressions, powered by tree-sitter [maintainer=@remi-gelinas]

License

Notifications You must be signed in to change notification settings

nix-community/nix-ts-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-ts-mode

https://melpa.org/packages/nix-ts-mode-badge.svg https://stable.melpa.org/packages/nix-ts-mode-badge.svg https://img.shields.io/github/actions/workflow/status/nix-community/nix-ts-mode/trunk.yaml.svg?label=Trunk&event=push&branch=trunk

An Emacs major mode for editing Nix expressions, powered by the new built-in tree-sitter support in Emacs 29 and the community-maintained Nix tree-sitter grammar.

Usage

nix-ts-mode only provides syntax highlighting for now, but will eventually support other tree-sitter powered features such as sexp-movement and smart indenting. After installing, enable the mode for Nix files like so:

(require 'nix-ts-mode)
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-ts-mode))

Or with use-package:

(use-package nix-ts-mode
 :mode "\\.nix\\'")