plugins/undotree: switch to settings-style

This commit is contained in:
Gaetan Lepage 2024-02-14 10:35:49 +01:00 committed by Gaétan Lepage
parent 9d4d529ee7
commit 750ec713dd

View file

@ -13,120 +13,55 @@ with helpers.vim-plugin;
globalPrefix = "undotree_"; globalPrefix = "undotree_";
deprecateExtraConfig = true; deprecateExtraConfig = true;
options = { # TODO introduced 2024-02-22: remove 2024-04-22
windowLayout = mkDefaultOpt { imports = let
type = types.int; basePluginPath = ["plugins" "undotree"];
description = '' in
Window layout for undotree. mapAttrsToList
Check https://github.com/mbbill/undotree/blob/master/plugin/undotree.vim#L29 for reference (
''; old: new:
mkRenamedOptionModule
(basePluginPath ++ [old])
(basePluginPath ++ ["settings" new])
)
{
windowLayout = "WindowLayout";
shortIndicators = "ShortIndicators";
windowWidth = "WindowWidth";
diffHeight = "DiffHeight";
autoOpenDiff = "AutoOpenDiff";
focusOnToggle = "FocusOnToggle";
treeNodeShape = "TreeNodeShape";
diffCommand = "DiffCommand";
relativeTimestamp = "RelativeTimestamp";
highlightChangedText = "HighlightChangedText";
highlightChangesWithSign = "HighlightChangesWithSign";
highlightSyntaxAdd = "HighlightSyntaxAdd";
highlightSyntaxChange = "HighlightSyntaxChange";
highlightSyntaxDel = "HighlightSyntaxDel";
showHelpLine = "ShowHelpLine";
showCursorLine = "ShowCursorLine";
}; };
shortIndicators = mkDefaultOpt { settingsExample = {
type = types.bool; WindowLayout = 4;
description = '' ShortIndicators = false;
E.g. use 'd' instead of 'days' DiffpanelHeight = 10;
DiffAutoOpen = true;
Default: `false` SetFocusWhenToggle = true;
''; SplitWidth = 40;
}; TreeNodeShape = "*";
TreeVertShape = "|";
windowWidth = mkDefaultOpt { TreeSplitShape = "/";
type = types.int; TreeReturnShape = "\\";
description = "Undotree window width"; DiffCommand = "diff";
}; RelativeTimestamp = true;
HighlightChangedText = true;
diffHeight = mkDefaultOpt { HighlightChangedWithSign = true;
type = types.int; HighlightSyntaxAdd = "DiffAdd";
description = "Undotree diff panel height"; HighlightSyntaxChange = "DiffChange";
}; HighlightSyntaxDel = "DiffDelete";
HelpLine = true;
autoOpenDiff = mkDefaultOpt { CursorLine = true;
type = types.bool;
description = ''
Auto open diff window
Default: `true`
'';
};
focusOnToggle = mkDefaultOpt {
type = types.bool;
description = ''
Focus undotree after being opened
Default: `false`
'';
};
treeNodeShape = mkDefaultOpt {
type = types.str;
description = "Tree node shape";
};
diffCommand = mkDefaultOpt {
type = types.str;
description = "Diff command";
};
relativeTimestamp = mkDefaultOpt {
type = types.bool;
description = ''
Use a relative timestamp.
Default: `true`
'';
};
highlightChangedText = mkDefaultOpt {
type = types.bool;
description = ''
Highlight changed text
Default: `true`
'';
};
highlightChangesWithSign = mkDefaultOpt {
type = types.bool;
description = ''
Highlight changes with a sign in the gutter
Default: `true`
'';
};
highlightSyntaxAdd = mkDefaultOpt {
type = types.str;
description = "Added lines highlight group";
};
highlightSyntaxChange = mkDefaultOpt {
type = types.str;
description = "Changed lines highlight group";
};
highlightSyntaxDel = mkDefaultOpt {
type = types.str;
description = "Deleted lines highlight group";
};
showHelpLine = mkDefaultOpt {
type = types.bool;
description = ''
Show help line.
Default: `true`
'';
};
showCursorLine = mkDefaultOpt {
type = types.bool;
description = ''
Show cursor line
Default: `true`
'';
};
}; };
} }