Editor Modes for Nix Files: Difference between revisions
imported>Toraritte m Add relevant pages |
imported>Fricklerhandwerk No edit summary |
||
Line 70: | Line 70: | ||
* [[Nix Expression Language: Learning resources|Learning resources]] | * [[Nix Expression Language: Learning resources|Learning resources]] | ||
[[Category:Nix | [[Category:Nix Language]] | ||
[[Category:Guide]] | [[Category:Guide]] |
Revision as of 08:18, 4 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
- nix-mode official available in melpa
- @marsam's nix-mode
- nix-buffer
- nix-update-el
- rnix-lsp
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
- nix-eclipse - development stopped in 2010
Sublime Text
Atom
Visual Studio Code
- vscode-nix on github
- vscode-nix-ide on GitHub and VSCode Store with support to format and lint