Editor Modes for Nix Files: Difference between revisions

From NixOS Wiki
imported>Artturin
add rnix-lsp
imported>Toraritte
m Add categories
Line 1: Line 1:
This is a list of editor modes for Nix syntax.
Nix language has decent syntax highlighting (SH) support among popular code editors, but refactoring/autocomplete is still rare. Below is a list of editor modes for Nix syntax.  


== Emacs ==
== Emacs ==
Line 64: Line 64:
== nano ==
== nano ==
* [https://github.com/seitz/nanonix nanonix]
* [https://github.com/seitz/nanonix nanonix]
[[Category:Nix Expression Language]]
[[Category:Guide]]

Revision as of 03:05, 3 August 2022

Nix language has decent syntax highlighting (SH) support among popular code editors, but refactoring/autocomplete is still rare. Below is a list of editor modes for Nix syntax.

Emacs

Vim

rnix-lsp

instructions are in the readme

vim-addon-nix

This plugin supports syntax highlighting and simple syntax and undeclared variable checking.

Usage with VAM package manager:

{ # /etc/nixos/configuration.nix
  environment.systemPackages = [
    (pkgs.vim_configurable.customize {
      name = "vim";
      vimrcConfig.vam.pluginDictionaries = [
        # vim-nix handles indentation better but does not perform sanity
        { names = [ "vim-addon-nix" ]; ft_regex = "^nix\$"; }
      ];
    })
  ];
}

vim-nix

vim-nix *only* supports syntax-highighting.

Usage with vim package manager:

{ # /etc/nixos/configuration.nix
  environment.systemPackages = [
    (pkgs.vim_configurable.customize {
      name = "vim";
      vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
        start = [ vim-nix ]; # load plugin on startup
      };
    })
  ];
}

IntelliJ IDEA

Eclipse

Sublime Text

Atom

Visual Studio Code

Howl

Far2l

nano