modules/ui: switch to explicit lib calls

This commit is contained in:
raf 2024-03-15 15:01:46 +03:00 committed by Ching Pei Yang
commit 5955d53077
9 changed files with 37 additions and 32 deletions

View file

@ -7,21 +7,21 @@
inherit (lib.strings) concatStringsSep;
inherit (lib.nvim.lua) attrsetToLuaTable;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.ui.smartcolumn;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["smartcolumn"];
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",
})
'';
};
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",
})
'';
};
}

View file

@ -1,6 +1,6 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) attrsOf either nullOr listOf int str submodule;
inherit (lib.types) nullOr int str submodule attrsOf either listOf;
in {
options.vim.ui.smartcolumn = {
enable = mkEnableOption "line length indicator";