@@ -39,6 +39,7 @@ Table of Contents *lazy.nvim-table-of-contents*
39
39
8. 🔥 Developers | lazy.nvim-🔥-developers |
40
40
- Best Practices | lazy.nvim-🔥-developers-best-practices |
41
41
- Building | lazy.nvim-🔥-developers-building |
42
+ - Minit (Minimal Init) | lazy.nvim-🔥-developers-minit-(minimal-init) |
42
43
9. Links | lazy.nvim-links |
43
44
44
45
==============================================================================
@@ -1260,6 +1261,90 @@ Use `vim.log.levels.TRACE` to only show the message as a **status** message for
1260
1261
the task.
1261
1262
1262
1263
1264
+
1265
+ MINIT (MINIMAL INIT) *lazy.nvim-🔥-developers-minit-(minimal-init)*
1266
+
1267
+ **lazy.nvim** comes with some built-in functionality to help you create a
1268
+ minimal init for your plugin.
1269
+
1270
+ I mainly use this for testing and for users to create a `repro.lua ` .
1271
+
1272
+ When running in **headless** mode, **lazy.nvim** will log any messages to the
1273
+ terminal. See `opts.headless` for more info.
1274
+
1275
+ **minit** will install/load all your specs and will always run an update as
1276
+ well.
1277
+
1278
+
1279
+ BOOTSTRAP ~
1280
+
1281
+ >lua
1282
+ -- setting this env will override all XDG paths
1283
+ vim.env.LAZY_STDPATH = ".tests"
1284
+ -- this will install lazy in your stdpath
1285
+ load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua "))()
1286
+ <
1287
+
1288
+
1289
+ TESTING WITH BUSTED ~
1290
+
1291
+ This will add `" lunarmodules/busted" ` , configure `hererocks` and run `busted` .
1292
+
1293
+ Below is an example of how I use **minit** to run tests with busted
1294
+ <https://olivinelabs.com/busted/ > in **LazyVim**.
1295
+
1296
+ >lua
1297
+ #!/usr/bin/env -S nvim -l
1298
+
1299
+ vim.env.LAZY_STDPATH = ".tests"
1300
+ load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua "))()
1301
+
1302
+ -- Setup lazy.nvim
1303
+ require("lazy.minit").busted({
1304
+ spec = {
1305
+ "LazyVim/starter",
1306
+ "williamboman/mason-lspconfig.nvim",
1307
+ "williamboman/mason.nvim",
1308
+ "nvim-treesitter/nvim-treesitter",
1309
+ },
1310
+ })
1311
+ <
1312
+
1313
+ To use this, you can run:
1314
+
1315
+ >sh
1316
+ nvim -l ./tests/busted.lua tests
1317
+ <
1318
+
1319
+ If you want to inspect the test environment, run:
1320
+
1321
+ >sh
1322
+ nvim -u ./tests/busted.lua
1323
+ <
1324
+
1325
+
1326
+ REPRO.LUA ~
1327
+
1328
+ >lua
1329
+ vim.env.LAZY_STDPATH = ".repro"
1330
+ load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua "))()
1331
+
1332
+ require("lazy.minit").repro({
1333
+ spec = {
1334
+ "stevearc/conform.nvim",
1335
+ "nvim-neotest/nvim-nio",
1336
+ },
1337
+ })
1338
+
1339
+ -- do anything else you need to do to reproduce the issue
1340
+ <
1341
+
1342
+ Then run it with:
1343
+
1344
+ >sh
1345
+ nvim -u repro.lua
1346
+ <
1347
+
1263
1348
==============================================================================
1264
1349
9. Links *lazy.nvim-links*
1265
1350
0 commit comments