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