From 7b58caaa9ff001c6ce0e9a04c3a4aa03f6b9bb45 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 16 Mar 2025 00:53:49 +0300 Subject: [PATCH] init/autocmds: add example to the autocmds option --- modules/neovim/init/autocmds.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/neovim/init/autocmds.nix b/modules/neovim/init/autocmds.nix index 5da7bc55..e74dd620 100644 --- a/modules/neovim/init/autocmds.nix +++ b/modules/neovim/init/autocmds.nix @@ -126,6 +126,20 @@ in { autocmds = mkOption { type = listOf autocommandType; default = []; + example = literalExpression '' + [ + { + enable = true; + desc = "Highlight yanks on copy"; + pattern = ["*"]; + callback = lib.generators.mkLuaInline ''' + function() + vim.highlight.on_yank({ timeout = 500 }) + end + '''; + } + ] + ''; description = '' A list of Neovim autocommands to be registered.