docs: added plugin properties

This commit is contained in:
Folke Lemaitre 2022-12-15 08:46:47 +01:00
parent f4720ee9f7
commit d975decf92
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 41 additions and 22 deletions

View File

@ -22,20 +22,21 @@
- 📋 Commit, branch, tag, version, and full [Semver](https://devhints.io/semver) support - 📋 Commit, branch, tag, version, and full [Semver](https://devhints.io/semver) support
- 📈 Statusline component to see the number of pending updates - 📈 Statusline component to see the number of pending updates
## Table of Contents ## 📄 Table of Contents
<!--toc:start--> <!-- toc:start -->
- [⚡️ Requirements](#-requirements) - [⚡️ Requirements](#-requirements)
- [📦 Installation](#📦-installation) - [📦 Installation](#-installation)
- [🔌 Plugin Spec](#🔌-plugin-spec) - [🔌 Plugin Spec](#-plugin-spec)
- [⚙️ Configuration](#-configuration) - [⚙️ Configuration](#-configuration)
- [🚀 Usage](#🚀-usage) - [🚀 Usage](#-usage)
- [📊 Profiler](#📊-profiler) - [📊 Profiler](#-profiler)
- [🪲 Debug](#🪲-debug) - [🪲 Debug](#-debug)
- [📦 Differences with Packer](#📦-differences-with-packer) - [📦 Differences with Packer](#-differences-with-packer)
- [📦 Other Neovim Plugin Managers in Lua](#📦-other-neovim-plugin-managers-in-lua) - [📦 Other Neovim Plugin Managers in Lua](#-other-neovim-plugin-managers-in-lua)
<!--toc:end-->
<!-- toc:end -->
## ⚡️ Requirements ## ⚡️ Requirements
@ -45,7 +46,7 @@
You can use the following Lua code to bootstrap **lazy.nvim** You can use the following Lua code to bootstrap **lazy.nvim**
<!-- bootstrap_start --> <!-- bootstrap:start -->
```lua ```lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
@ -62,7 +63,7 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
end end
``` ```
<!-- bootstrap_end --> <!-- bootstrap:end -->
Next step is to add **lazy.nvim** to the top of your `init.lua` Next step is to add **lazy.nvim** to the top of your `init.lua`
@ -87,11 +88,29 @@ require("lazy").setup({
## 🔌 Plugin Spec ## 🔌 Plugin Spec
| Property | Type | Description | | Property | Type | Description |
| -------- | ------- | ----------- | | ---------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Item1.1 | Item2.1 | Item3.1 | | `[1]` | `string?` | Short plugin url. Will be expanded using `config.git.url_format` |
| Item1.2 | Item2.2 | Item3.2 | | **dir** | `string?` | A directory pointing to a local plugin |
| **url** | `string?` | A custom git url where the plugin is hosted |
| **name** | `string?` | A custom name for the plugin used for the local plugin directory and as the dispay name |
| **dev** | `boolean?` | When `true`, a local plugin directory will be used instead. See `config.dev` |
| **lazy** | `boolean?` | When `true`, the plugin will only be loaded when needed. Lazy-loaded plugins are automatically loaded when their lua modules are `required`, or when one of the laz-loading handlers triggers |
| **enabled** | `boolean?` or `fun():boolean` | When `false`, or if the `function` returns false, then this plugin will not be used |
| **dependencies** | `LazySpec[]` | A list of plugin specs that should be loaded when the plugin loads. Dependencies are always lazy-loaded unless specified otherwise |
| **init** | `fun(LazyPlugin)` | `init` functions are always executed during startup |
| **config** | `fun(LazyPlugin)` | `config` is executed when the plugin loads |
| **build** | `fun(LazyPlugin)` | `build` is executed when a plugin is installed or updated |
| **branch** | `string?` | Branch of the repository |
| **tag** | `string?` | Tag of the repository |
| **commit** | `string?` | Commit of the repository |
| **version** | `string?` | Version to use from the repository. Full [Semver](https://devhints.io/semver) ranges are supported |
| **pin** | `boolean?` | When `true`, this plugin will not be included in updates |
| **event** | `string?` or `string[]` | Lazy-load on event |
| **cmd** | `string?` or `string[]` | Lazy-load on command |
| **ft** | `string?` or `string[]` | Lazy-load on filetype |
| **keys** | `string?` or `string[]` | Lazy-load on key mapping |
<!-- spec_start --> <!-- spec:start -->
```lua ```lua
return { return {
@ -168,13 +187,13 @@ return {
} }
``` ```
<!-- spec_end --> <!-- spec:end -->
## ⚙️ Configuration ## ⚙️ Configuration
**lazy.nvim** comes with the following defaults: **lazy.nvim** comes with the following defaults:
<!-- config_start --> <!-- config:start -->
```lua ```lua
{ {
@ -260,7 +279,7 @@ return {
} }
``` ```
<!-- config_end --> <!-- config:end -->
## 🚀 Usage ## 🚀 Usage