From a76cf517954c04509e422911b100afa93902c3da Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 9 Sep 2025 06:00:45 +0000 Subject: [PATCH] Deploy PR #1138 preview --- docs-preview-1138/index.xhtml | 4 ++-- docs-preview-1138/options.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs-preview-1138/index.xhtml b/docs-preview-1138/index.xhtml index a67659a7..e87395e1 100644 --- a/docs-preview-1138/index.xhtml +++ b/docs-preview-1138/index.xhtml @@ -787,7 +787,7 @@ Each entry in the list is a submodule with the following options:

Autocommands (vim.autocmds)

Autocommands (autocmd) trigger actions based on events happening within Neovim (e.g., saving a file, entering a buffer). Each entry in the list is a submodule -with the following options:

OptionTypeDefaultDescriptionExample
enablebooltrueEnables or disables this autocommand definition.true
eventnullOr (listOf str)nullRequired. List of Neovim events that trigger this autocommand (e.g., BufWritePre, FileType).[ "BufWritePre" ]
patternnullOr (listOf str)nullList of file patterns (globs) to match against (e.g., *.py, *). If null, matches all files for the given event.[ "*.lua", "*.nix" ]
callbacknullOr luaInlinenullA Lua function to execute when the event triggers. Use lib.nvim.types.luaInline or lib.options.literalExpression "mkLuaInline '''...'''". Cannot be used with command.lib.nvim.types.luaInline "function() print('File saved!') end"
commandnullOr strnullA Vimscript command to execute when the event triggers. Cannot be used with callback."echo 'File saved!'"
groupnullOr strnullThe name of an augroup (defined in vim.augroups) to associate this autocommand with."MyCustomAuGroup"
descnullOr strnullA description for the autocommand (useful for introspection)."Format buffer on save"
onceboolfalseIf true, the autocommand runs only once and then automatically removes itself.false
nestedboolfalseIf true, allows this autocommand to trigger other autocommands.false

Warning

You cannot define both callback (for Lua functions) and command (for +with the following options:

OptionTypeDefaultDescriptionExample
enablebooltrueEnables or disables this autocommand definition.true
eventnullOr (listOf str)nullRequired. List of Neovim events that trigger this autocommand (e.g., BufWritePre, FileType).[ "BufWritePre" ]
patternnullOr (listOf str)nullList of file patterns (globs) to match against (e.g., *.py, *). If null, matches all files for the given event.[ "*.lua", "*.nix" ]
callbacknullOr luaInlinenullA Lua function to execute when the event triggers. Use lib.generators.mkLuaInline. Cannot be used with command.lib.generators.mkLuaInline "function() print('File saved!') end"
commandnullOr strnullA Vimscript command to execute when the event triggers. Cannot be used with callback."echo 'File saved!'"
groupnullOr strnullThe name of an augroup (defined in vim.augroups) to associate this autocommand with."MyCustomAuGroup"
descnullOr strnullA description for the autocommand (useful for introspection)."Format buffer on save"
onceboolfalseIf true, the autocommand runs only once and then automatically removes itself.false
nestedboolfalseIf true, allows this autocommand to trigger other autocommands.false

Warning

You cannot define both callback (for Lua functions) and command (for Vimscript) for the same autocommand. Choose one.

Examples:

{ lib, ... }:
 {
   vim.augroups = [ { name = "UserSetup"; } ];
@@ -799,7 +799,7 @@ Vimscript) for the same autocommand. Choose one.

Default: null

-

Example:

mkLuaInline ''
+

Example:

lib.generators.mkLuaInline ''
   function()
       print("Saving a Lua file...")
   end