Difference between revisions of "Editor Modes for Nix Files"

From NixOS Wiki
Jump to: navigation, search
m (Remove trailing whitespace in code blocks)
Line 5: Line 5:
 
* [https://github.com/emacs-pe/nix-mode @marsam's nix-mode]
 
* [https://github.com/emacs-pe/nix-mode @marsam's nix-mode]
 
* [https://github.com/shlevy/nix-buffer nix-buffer]
 
* [https://github.com/shlevy/nix-buffer nix-buffer]
 +
* [https://github.com/jwiegley/nix-update-el nix-update-el]
 
== Vim ==
 
== Vim ==
 
=== vim-addon-nix ===
 
=== vim-addon-nix ===

Revision as of 03:22, 28 March 2018

This is a list of editor modes for Nix syntax.

Emacs

Vim

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