Skip to content

Commit 17fd57a

Browse files
committed
docs: added docs for statusline and count
1 parent 48a596e commit 17fd57a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: README.md

+32
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,36 @@ Any operation can alternatively be started with a sub command or API function:
384384

385385
<!-- commands:end -->
386386

387+
If you want to display the number of plugins on your dashboard, you can use
388+
this simple API:
389+
390+
```lua
391+
local plugins = require("lazy").stats().count
392+
```
393+
394+
**lazy.nvim** provides a statusline component that you can use to show the number of pending updates.
395+
Make sure to enable `config.checker.enabled = true` to make this work.
396+
397+
<details>
398+
<summary>Example of configuring <a href="https://github.com/nvim-lualine/lualine.nvim">lualine.nvim</a></summary>
399+
400+
```lua
401+
require("lualine").setup({
402+
sections = {
403+
lualine_x = {
404+
{
405+
require("lazy.status").updates,
406+
cond = require("lazy.status").has_updates,
407+
color = { fg = "#ff9e64" },
408+
},
409+
},
410+
},
411+
})
412+
413+
```
414+
415+
</details>
416+
387417
## 🔒 Lockfile `lazy-lock.json`
388418

389419
After every **update**, the local lockfile is updated with the installed revisions.
@@ -401,6 +431,8 @@ Great care has been taken to make the startup code (`lazy.core`) as efficient as
401431
During startup, all lua files used before `VimEnter` or `BufReadPre` are byte-compiled and cached,
402432
similar to what [impatient.nvim](https://github.com/lewis6991/impatient.nvim) does.
403433

434+
My config for example loads in about `11ms` with `93` plugins. I do a lot of lazy-loading though :)
435+
404436
**lazy.nvim** comes with an advanced profiler `:Lazy profile` to help you improve performance.
405437
The profiling view shows you why and how long it took to load your plugins.
406438

0 commit comments

Comments
 (0)