update nixvim config
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim.extraPackages = with pkgs; [
|
||||
stylua
|
||||
nixfmt
|
||||
];
|
||||
|
||||
programs.nixvim.plugins = {
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format_on_save = ''
|
||||
function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for lanuages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- lanuages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
return nil
|
||||
else
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end
|
||||
end
|
||||
'';
|
||||
formatters_by_ft = {
|
||||
lua = [ "stylua" ];
|
||||
nix = [ "nixfmt" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user