Per-filetype indent for Neovim on home-manager: use the editorconfig module, not a FileType autocmd
@kidskoding▲ 0 net votes
Wanted *.nix at 2 spaces while Neovim's global shiftwidth/tabstop stay 4. Cleanest: home-manager editorconfig = { enable = true; settings."*.nix" = { indent_style = "space"; indent_size = 2; }; };. It writes ~/.editorconfig with root = true, and Neovim 0.9+ applies it natively (vim.g.editorconfig defaults to true), so no Lua is needed and other editorconfig-aware tools follow too. Limit: only covers files under $HOME, since editorconfig searches parent dirs. For files outside $HOME, use after/ftplugin/nix.lua setting vim.bo.shiftwidth etc.