neovim-flake/modules/ui/smartcolumn/config.nix

28 lines
744 B
Nix
Raw Normal View History

2023-04-05 15:58:56 +02:00
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.strings) concatStringsSep;
inherit (lib.nvim.lua) attrsetToLuaTable;
inherit (lib.nvim.dag) entryAnywhere;
2023-04-05 15:58:56 +02:00
cfg = config.vim.ui.smartcolumn;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["smartcolumn"];
2023-04-05 15:58:56 +02:00
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",
})
'';
2023-04-05 15:58:56 +02:00
};
}