All Projects → NixOS → Nix Mode

NixOS / Nix Mode

Licence: lgpl-2.1
An Emacs major mode for editing Nix expressions.

Projects that are alternatives of or similar to Nix Mode

Nix Doom Emacs
doom-emacs packaged for Nix
Stars: ✭ 132 (-3.65%)
Mutual labels:  nix, emacs
Modern Cpp Font Lock
C++ font-lock for Emacs
Stars: ✭ 159 (+16.06%)
Mutual labels:  emacs, syntax-highlighting
Dotfiles
well-tailored NixOS & nix-darwin dotfiles
Stars: ✭ 63 (-54.01%)
Mutual labels:  nix, emacs
Prism.el
Disperse Lisp forms (and other languages) into a spectrum of colors by depth
Stars: ✭ 141 (+2.92%)
Mutual labels:  emacs, syntax-highlighting
Dotfiles
Configuration files for XMonad, Emacs, NixOS, Taffybar and more.
Stars: ✭ 127 (-7.3%)
Mutual labels:  nix, emacs
Diff2html
Pretty diff to html javascript library (diff2html)
Stars: ✭ 1,867 (+1262.77%)
Mutual labels:  syntax-highlighting
Emacs Powerthesaurus
Powerthesaurus integration for Emacs
Stars: ✭ 132 (-3.65%)
Mutual labels:  emacs
Emacs Solaire Mode
If only certain buffers could be so grossly incandescent.
Stars: ✭ 129 (-5.84%)
Mutual labels:  emacs
Flyspell Correct
Distraction-free words correction with flyspell via selected interface.
Stars: ✭ 136 (-0.73%)
Mutual labels:  emacs
Install Nix Action
Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Stars: ✭ 132 (-3.65%)
Mutual labels:  nix
Nixos Manager
Manage your NixOS packages and configuration via a simple, intuitive UI
Stars: ✭ 128 (-6.57%)
Mutual labels:  nix
Psc Ide Emacs
Emacs integration for PureScript's psc-ide tool.
Stars: ✭ 130 (-5.11%)
Mutual labels:  emacs
Vscode Emacs Mcx
Awesome Emacs Keymap - VSCode emacs keybinding with multi cursor support
Stars: ✭ 135 (-1.46%)
Mutual labels:  emacs
Nord Vim
An arctic, north-bluish clean and elegant Vim theme.
Stars: ✭ 1,987 (+1350.36%)
Mutual labels:  syntax-highlighting
Nix Files
My NixOS configuration and custom Nix derivations.
Stars: ✭ 136 (-0.73%)
Mutual labels:  nix
Zsh Nix Shell
zsh plugin that lets you use zsh in nix-shell shells.
Stars: ✭ 130 (-5.11%)
Mutual labels:  nix
Emacs Gdscript Mode
An Emacs package to get GDScript support and syntax highlighting.
Stars: ✭ 132 (-3.65%)
Mutual labels:  emacs
Magic Latex Buffer
Magical syntax highlighting for LaTeX-mode buffers
Stars: ✭ 135 (-1.46%)
Mutual labels:  emacs
Zsh Syntax Highlighting Filetypes
zsh syntax highlighting with dircolors in realtime
Stars: ✭ 130 (-5.11%)
Mutual labels:  syntax-highlighting
Eval In Repl
Consistent ESS-like eval interface for various REPLs
Stars: ✭ 130 (-5.11%)
Mutual labels:  emacs

nix-mode

MELPA MELPA Stable Build Status

An Emacs major mode for editing Nix expressions. There is also a manual available at nix-mode.org.

Submodes

A quick list of what is provided.

nix-mode.el

This is the main usage of nix-mode. This provides basic handling of .nix files. Syntax highlighting and indentation support using SMIE are provided. nix-mode can be used with the following snippet:

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

or with use-package:

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

nix.el

nix.el contains some miscellaneous tools for Nix developers. Interactive functions include:

  • nix-unpack - unpack source of a Nix attribute.

    To use this just type:

    M-x nix-unpack

    Followed by your Nix path & attribute path.

  • nix-build - build a Nix derivation.

    This is meant to work similarly to M-x compile. It will use your current directory & build it if there is a default.nix there.

nix.el also provides some basic functions for interfacing with Nix. Some variables are provided to point to the Nix binaries that can be used in Lisp code:

  • nix-executable
  • nix-build-executable
  • nix-instantiate-executable
  • nix-store-executable
  • nix-shell-executable

Other useful functions for Lisp scripts are provided:

  • nix-system - Get the current system, detected by Nix

nix-repl.el

nix-repl.el has two purposes.

First, it provides an interface for completion, used by nix-company.el.

Second, it provides an interactive function to open an repl. You can open this with:

M-x nix-repl

nix-prettify-mode.el

When nix-prettify-mode is enabled, hash-parts of the Nix store file names are prettified, i.e. displayed as nix-prettify-char character ( by default.).

This is based on a similar mode for Guix: Prettify Mode (Emacs-Guix Reference Manual).

Origins

This repository is based off of the nix-mode.el file originally located in the Nix repository at misc/emacs/nix-mode.el. Please see the CHANGELOG file for a list of changes.

Other Emacs packages

@shlevy has an excellent package for integrating nix-shell into emacs. It is available at shlevy/nix-buffer.

@travisbhartwell also has some package dealing with Nix. They are available at travisbhartwell/nix-emacs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].