broken more granular indent options

This commit is contained in:
mewoocat 2026-01-13 00:16:46 -06:00
commit a0d4238282
5 changed files with 33 additions and 17 deletions

View file

@ -82,17 +82,17 @@ in {
# maybe put generic function to set indent for provided langs
# Then we can just call it with the lib arg
setLanguageIndent = {language, indentSize}: {
setLanguageIndent = {language, tabstop, softtabstop, shiftwidth}: {
vim.autocmds = [
{
desc = "Sets indent for nix files";
event = ["FileType"];
event = [ "FileType" ];
pattern = [ language ];
callback = mkLuaInline ''
function()
vim.bo.tabstop = ${toString indentSize}
vim.bo.softtabstop = ${toString indentSize}
vim.bo.shiftwidth = ${toString indentSize}
${if tabstop != null then "vim.bo.tabstop = " + toString tabstop else ""}
${if softtabstop != null then "vim.bo.softtabstop = " + toString softtabstop else ""}
${if shiftwidth != null then "vim.bo.shiftwidth = " + toString shiftwidth else ""}
end
'';
once = true;