feat(smartcolumn): custom setup opts

This commit is contained in:
Ching Pei Yang 2024-03-10 21:00:14 +00:00
commit 5ea6272bee
3 changed files with 30 additions and 27 deletions

View file

@ -4,9 +4,8 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.strings) concatStringsSep;
inherit (lib.nvim.lua) attrsetToLuaTable;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.ui.smartcolumn;
in {
@ -15,13 +14,7 @@ in {
startPlugins = ["smartcolumn"];
vim.luaConfigRC.smartcolumn = entryAnywhere ''
require("smartcolumn").setup({
colorcolumn = "${toString cfg.showColumnAt}",
-- { "help", "text", "markdown", "NvimTree", "alpha"},
disabled_filetypes = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.disabledFiletypes)} },
custom_colorcolumn = ${attrsetToLuaTable cfg.columnAt.languages},
scope = "file",
})
require("smartcolumn").setup(${toLuaObject cfg.setupOpts})
'';
};
}