Merge pull request #844 from Noah765/improve-autocommand-descriptions

autocmds: improve option descriptions
This commit is contained in:
raf 2025-04-21 06:52:13 +00:00 committed by GitHub
commit 499db0e09a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@
mkEnableOption "" mkEnableOption ""
// { // {
default = true; default = true;
description = "Whether to enable this autocommand"; description = "Whether to enable this autocommand.";
}; };
event = mkOption { event = mkOption {
@ -31,7 +31,7 @@
type = nullOr (listOf str); type = nullOr (listOf str);
default = null; default = null;
example = ["*.lua" "*.vim"]; example = ["*.lua" "*.vim"];
description = "The file pattern(s) that determine when the autocommand applies)."; description = "The file pattern(s) that determine when the autocommand applies.";
}; };
callback = mkOption { callback = mkOption {
@ -44,13 +44,16 @@
end end
'''' ''''
''; '';
description = "The file pattern(s) that determine when the autocommand applies."; description = "Lua function to be called when the event(s) are triggered.";
}; };
command = mkOption { command = mkOption {
type = nullOr str; type = nullOr str;
default = null; default = null;
description = "Vim command string instead of a Lua function."; description = ''
Vim command to be executed when the event(s) are triggered.
Cannot be defined if the `callback` option is already defined.
'';
}; };
group = mkOption { group = mkOption {
@ -70,7 +73,7 @@
once = mkOption { once = mkOption {
type = bool; type = bool;
default = false; default = false;
description = "Whether autocommand run only once."; description = "Whether to run the autocommand only once.";
}; };
nested = mkOption { nested = mkOption {
@ -87,7 +90,7 @@
mkEnableOption "" mkEnableOption ""
// { // {
default = true; default = true;
description = "Whether to enable this autogroup"; description = "Whether to enable this autocommand group.";
}; };
name = mkOption { name = mkOption {
@ -118,8 +121,8 @@ in {
autocommands together. Groups allow multiple autocommands to be cleared autocommands together. Groups allow multiple autocommands to be cleared
or redefined collectively, preventing duplicate definitions. or redefined collectively, preventing duplicate definitions.
Each autogroup consists of a name, a boolean indicating whether to clear Each autogroup consists of a name and a boolean indicating whether to clear
existing autocommands, and a list of associated autocommands. existing autocommands.
''; '';
}; };
@ -129,8 +132,8 @@ in {
description = '' description = ''
A list of Neovim autocommands to be registered. A list of Neovim autocommands to be registered.
Each entry defines an autocommand, specifying events, patterns, optional Each entry defines an autocommand, specifying events, patterns, a callback or Vim
callbacks, commands, groups, and execution settings. command, an optional group, a description, and execution settings.
''; '';
}; };
}; };