This commit is contained in:
Snoweuph 2026-06-05 15:53:31 +02:00 committed by GitHub
commit 3a8dcb3854
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 64 additions and 13 deletions

View file

@ -60,8 +60,9 @@ Vimscript) for the same autocommand. Choose one.
**Examples:**
```nix
{ lib, ... }:
{
{ lib, ... }: let
inherit (lib.generators) mkLuaInline;
in {
vim.augroups = [ { name = "UserSetup"; } ];
vim.autocmds = [
@ -71,7 +72,7 @@ Vimscript) for the same autocommand. Choose one.
pattern = [ "*.lua" ];
group = "UserSetup";
desc = "Notify after saving Lua file";
callback = lib.generators.mkLuaInline ''
callback = mkLuaInline ''
function()
vim.notify("Lua file saved!", vim.log.levels.INFO)
end
@ -101,7 +102,7 @@ Vimscript) for the same autocommand. Choose one.
event = [ "BufWinEnter" ];
pattern = [ "*" ];
desc = "Simple greeting on entering a buffer window";
callback = lib.generators.mkLuaInline ''
callback = mkLuaInline ''
function(args)
print("Entered buffer: " .. args.buf)
end

View file

@ -36,7 +36,7 @@ order to configure the added plugin,
in {
# luaConfigRC takes Lua configuration verbatim and inserts it at an arbitrary
# position by default or if 'entryAnywhere' is used.
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
vim.luaConfigRC.aerial-nvim = entryAnywhere ''
require('aerial').setup {
-- your configuration here
}

View file

@ -10,11 +10,15 @@ In the following example, we are creating a custom injection, to highlight the
Lua string after `mkLuaInline`.
```nix
foo = mkLuaInline ''
function bar()
return 'foobar'
end
'';
let
inherit (lib.generators) mkLuaInline;
in {
foo = mkLuaInline ''
function bar()
return 'foobar'
end
'';
}
```
```nix

View file

@ -650,9 +650,11 @@ As you've seen above, `toLuaObject` is used to convert our nix attrSet
that return specific values as expected by the plugins.
```nix
{
let
inherit (lib.generators) mkLuaInline;
in {
vim.your-plugin.setupOpts = {
on_init = lib.generators.mkLuaInline ''
on_init = mkLuaInline ''
function()
print('we can write lua!')
end

View file

@ -323,6 +323,8 @@
[Snoweuph](https://github.com/snoweuph)
- Use nvf nix Tree-sitter injections in the docs.
- Allow the usage of `pks.tree-sitter-grammars` in
{option}`vim.treesitter.grammars` and language module tree-sitter package
options created via `mkGrammarOption`.