1.7 Nix editor setup: VS Code with nixd and nixfmt
Lesson 7 of 68 · 5:47
Up next in 5s…
About this lesson
The Nix language can feel strange at first, and reading it in a plain editor without any support makes that worse. Before the language lessons start, this video sets up Visual Studio Code for Nix: syntax highlighting, code completion, inline documentation and automatic formatting, using the Nix IDE extension, the nixd language server and nixfmt.
In this video
- Installing the Nix IDE extension, and why syntax coloring alone is not the whole story
- Wiring up
nixdandnixfmtthroughsettings.json, starting from a minimal config that just works - Installing both tools with
nix profile, including a bash shorthand for adding two packages at once - Completion in action: typing
packages.and picking real packages from nixpkgs - Documentation on mouseover, and where those docs actually come from, plus fixing horribly formatted code with one command
After this lesson
You write Nix with completion, inline documentation and a formatter, which makes everything from here on noticeably more comfortable.
Builds on: Installing tools to keep with nix profile (1.5.2)