Editor Modes for Nix Files: Difference between revisions

From NixOS Wiki
imported>Makefu
merge "nix expression language"
imported>Makefu
No edit summary
Line 1: Line 1:
This is a list of editor modes for Nix syntax.
This is a list of editor modes for Nix syntax.


* Emacs
== Emacs ==
** [https://github.com/NixOS/nix-mode nix-mode official] available in [https://melpa.org/ melpa]
* [https://github.com/NixOS/nix-mode nix-mode official] available in [https://melpa.org/ melpa]
** [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]
* Vim
== Vim ==
** [https://github.com/LnL7/vim-nix vim-nix]
=== vim-addon-nix ===
This plugin supports syntax highlighting and simple syntax and undeclared variable checking.
* [https://github.com/MarcWeber/vim-addon-nix vim-addon-nix on github]


Usage:
Usage with '''VAM''' package manager:
<syntaxHighlight lang="nix">{ # /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\$"; }
      ];
    })
  ];
}</syntaxHighlight>
=== vim-nix ===
vim-nix *only* supports syntax-highighting.
* [https://github.com/LnL7/vim-nix vim-nix on github]
 
Usage with '''vim package manager''':


<syntaxHighlight lang="nix">{ # /etc/nixos/configuration.nix
<syntaxHighlight lang="nix">{ # /etc/nixos/configuration.nix
Line 21: Line 39:
}</syntaxHighlight>
}</syntaxHighlight>


* IntelliJ IDEA
== IntelliJ IDEA ==
** [https://github.com/NixOS/nix-idea nix-idea]
* [https://github.com/NixOS/nix-idea nix-idea on github]
* Eclipse
== Eclipse ==
** [https://github.com/NixOS/nix-eclipse nix-eclipse] - development stopped in 2010
* [https://github.com/NixOS/nix-eclipse nix-eclipse] - development stopped in 2010
* Sublime Text
== Sublime Text ==
** [https://github.com/wmertens/sublime-nix sublime-nix]
* [https://github.com/wmertens/sublime-nix sublime-nix on github]
* Atom
== Atom ==
** [https://github.com/wmertens/atom-nix atom-nix]
* [https://github.com/wmertens/atom-nix atom-nix on github]
* Visual Studio Code
== Visual Studio Code ==
** [https://github.com/bbenoist/vscode-nix vscode-nix]
* [https://github.com/bbenoist/vscode-nix vscode-nix on github]
* Howl
== Howl ==
** [https://github.com/rokf/howl-nix howl-nix]
* [https://github.com/rokf/howl-nix howl-nix on github]
* Far2l
== Far2l ==
** [https://github.com/NixOS/nixpkgs/pull/28238]
* [https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/far2l/default.nix far2l with nix syntax highlighting patch in nixpkgs]


=== Custom Nix Editors ===
== nano ==
* [https://github.com/seitz/nanonix nano] - simple SH
* [https://github.com/seitz/nanonix nanonix]

Revision as of 05:18, 6 October 2017

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