mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-12 21:47:47 +00:00
Merge 78066496b2 into ceaae0eb2e
This commit is contained in:
commit
dbe66e1d05
3 changed files with 45 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
|||
inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr uniq;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) luaInline;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
in {
|
||||
# TODO: remove
|
||||
diagnosticsToLua = {
|
||||
|
|
@ -77,4 +78,26 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
# maybe put generic function to set indent for provided langs
|
||||
# Then we can just call it with the lib arg
|
||||
|
||||
setLanguageIndent = {language, indentSize}: {
|
||||
vim.autocmds = [
|
||||
{
|
||||
desc = "Sets indent for nix files";
|
||||
event = ["FileType"];
|
||||
pattern = [ language ];
|
||||
callback = mkLuaInline ''
|
||||
function()
|
||||
vim.bo.tabstop = ${toString indentSize}
|
||||
vim.bo.softtabstop = ${toString indentSize}
|
||||
vim.bo.shiftwidth = ${toString indentSize}
|
||||
end
|
||||
'';
|
||||
once = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue