mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-01 16:45:55 +00:00
experimenting
This commit is contained in:
parent
4b95ae106c
commit
f4072b710a
1 changed files with 28 additions and 1 deletions
|
|
@ -106,6 +106,12 @@ in {
|
|||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
|
||||
indentSize = mkOption {
|
||||
description = "Sets the indent size in spaces for .nix files";
|
||||
type = int;
|
||||
default = 2;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -160,5 +166,26 @@ in {
|
|||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
||||
vim = {
|
||||
autocmds = [
|
||||
{
|
||||
desc = "Sets indent for nix files";
|
||||
event = ["BufEnter"];
|
||||
pattern = [
|
||||
"*.nix"
|
||||
"*.md"
|
||||
];
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
vim.opt.tabstop = ${cfg.indentSize}
|
||||
vim.opt.softtabstop = ${cfg.indentSize}
|
||||
vim.opt.shiftwidth = ${cfg.indentSize}
|
||||
end
|
||||
'';
|
||||
once = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue