mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-14 08:36:57 +00:00
docs: use nvf injections in docs
This commit is contained in:
parent
5ee7fb1986
commit
43de0c6acb
8 changed files with 64 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue