2023-11-07 00:50:27 +00:00
|
|
|
{lib, ...}: let
|
2024-03-16 13:25:30 +00:00
|
|
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
|
|
inherit (lib.types) attrsOf either nullOr listOf int str submodule;
|
2023-11-07 00:50:27 +00:00
|
|
|
in {
|
2023-04-05 13:58:56 +00:00
|
|
|
options.vim.ui.smartcolumn = {
|
2023-06-05 20:10:25 +00:00
|
|
|
enable = mkEnableOption "line length indicator";
|
2023-04-05 13:58:56 +00:00
|
|
|
|
|
|
|
showColumnAt = mkOption {
|
2024-03-16 13:25:30 +00:00
|
|
|
type = nullOr int;
|
2023-04-05 13:58:56 +00:00
|
|
|
default = 120;
|
|
|
|
description = "The position at which the column will be displayed. Set to null to disable";
|
|
|
|
};
|
|
|
|
|
|
|
|
disabledFiletypes = mkOption {
|
2024-03-16 13:25:30 +00:00
|
|
|
type = listOf str;
|
2023-04-05 13:58:56 +00:00
|
|
|
default = ["help" "text" "markdown" "NvimTree" "alpha"];
|
|
|
|
description = "The filetypes smartcolumn will be disabled for.";
|
|
|
|
};
|
2023-04-11 10:57:34 +00:00
|
|
|
|
2023-06-04 11:12:08 +00:00
|
|
|
columnAt = {
|
2023-11-07 11:24:11 +00:00
|
|
|
languages = mkOption {
|
2023-06-04 11:12:08 +00:00
|
|
|
description = "The position at which smart column should be displayed for each individual buffer type";
|
2024-03-16 13:25:30 +00:00
|
|
|
type = submodule {
|
|
|
|
freeformType = attrsOf (either int (listOf int));
|
2023-06-04 11:12:08 +00:00
|
|
|
};
|
2023-06-04 14:36:01 +00:00
|
|
|
|
2023-11-07 11:24:11 +00:00
|
|
|
example = literalExpression ''
|
2023-06-04 14:36:01 +00:00
|
|
|
vim.ui.smartcolumn.columnAt.languages = {
|
|
|
|
nix = 110;
|
|
|
|
ruby = 120;
|
|
|
|
java = 130;
|
|
|
|
go = [90 130];
|
|
|
|
};
|
|
|
|
'';
|
2023-06-04 11:12:08 +00:00
|
|
|
};
|
2023-04-05 13:58:56 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|