mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-05 03:15:53 +00:00
broken more granular indent options
This commit is contained in:
parent
7267cf3570
commit
a0d4238282
5 changed files with 33 additions and 17 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue