mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-07 11:17:15 +00:00
working example
This commit is contained in:
parent
f4072b710a
commit
95f36449a7
2 changed files with 12 additions and 7 deletions
|
|
@ -77,4 +77,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# maybe put generic function to set indent for provided langs
|
||||||
|
# Then we can just call it with the lib arg
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,13 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames toString;
|
||||||
inherit (lib) concatStringsSep;
|
inherit (lib) concatStringsSep;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.types) enum;
|
inherit (lib.types) enum;
|
||||||
|
inherit (lib.types) int;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
|
|
@ -167,8 +168,8 @@ in {
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
vim = {
|
{
|
||||||
autocmds = [
|
vim.autocmds = [
|
||||||
{
|
{
|
||||||
desc = "Sets indent for nix files";
|
desc = "Sets indent for nix files";
|
||||||
event = ["BufEnter"];
|
event = ["BufEnter"];
|
||||||
|
|
@ -178,14 +179,15 @@ in {
|
||||||
];
|
];
|
||||||
callback = lib.generators.mkLuaInline ''
|
callback = lib.generators.mkLuaInline ''
|
||||||
function()
|
function()
|
||||||
vim.opt.tabstop = ${cfg.indentSize}
|
vim.opt.tabstop = ${toString cfg.indentSize}
|
||||||
vim.opt.softtabstop = ${cfg.indentSize}
|
vim.opt.softtabstop = ${toString cfg.indentSize}
|
||||||
vim.opt.shiftwidth = ${cfg.indentSize}
|
vim.opt.shiftwidth = ${toString cfg.indentSize}
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
once = true;
|
once = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
])
|
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue