docs: added usage and config

This commit is contained in:
Folke Lemaitre 2022-12-14 21:54:17 +01:00
parent eccc3883eb
commit 4392a58c22
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 102 additions and 0 deletions

102
README.md
View File

@ -46,6 +46,108 @@ You can use the following Lua code to bootstrap **lazy.nvim**
end
```
## 🚀 Usage
Add **lazy.nvim** to the top of your `init.lua`
```lua
-- You can use a lua module that contains your plugins.
-- All sub modules of the lua module will also be automatically loaded
-- This is the preferred setup so your plugin specs can be properly cached.
require("lazy").setup("config.plugins", {
-- add any optional configuration options here
})
-- Alternatively you can specify a plugin list
require("lazy").setup({
"folke/neodev.nvim",
"folke/which-key.nvim",
{ "folke/neoconf.nvim", cmd = "Neoconf" },
}, {
-- add any optional configuration options here
})
```
## ⚙️ Configuration
**lazy.nvim** comes with the following defaults:
```lua
{
root = vim.fn.stdpath("data") .. "/lazy", -- directory where plugins will be installed
defaults = {
lazy = false, -- should plugins be lazy-loaded?
version = nil,
-- version = "*", -- enable this to try installing the latest stable versions of plugins
},
lockfile = vim.fn.stdpath("config") .. "/lazy-lock.json", -- lockfile generated after running update.
concurrency = nil, ---@type number limit the maximum amount of concurrent tasks
git = {
-- defaults for the `Lazy log` command
-- log = { "-10" }, -- show the last 10 commits
log = { "--since=1 days ago" }, -- show commits from the last 3 days
timeout = 120, -- kill processes that take more than 2 minutes
url_format = "https://github.com/%s.git",
},
dev = {
-- directory where you store your local plugin projects
path = vim.fn.expand("~/projects"),
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = {}, -- For example {"folke"}
},
install = {
-- install missing plugins on startup. This doesn't increase startup time.
missing = true,
-- try to load one of these colorschemes when starting an installation during startup
colorscheme = { "habamax" },
},
ui = {
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
border = "none",
icons = {
cmd = " ",
config = "",
event = "",
ft = " ",
init = " ",
keys = " ",
plugin = " ",
runtime = " ",
source = " ",
start = "",
task = "✔ ",
},
throttle = 20, -- how frequently should the ui process render events
},
checker = {
-- automcatilly check for plugin updates
enabled = false,
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
notify = true, -- get a notification when new updates are found
frequency = 3600, -- check for updates every hour
},
performance = {
---@type LazyCacheConfig
cache = nil,
reset_packpath = true, -- reset the package path to improve startup time
rtp = {
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
---@type string[] list any plugins you want to disable here
disabled_plugins = {
-- "gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
-- "tarPlugin",
-- "tohtml",
-- "tutor",
-- "zipPlugin",
},
},
},
}
```
## Profiler
The profiling view shows you why and how long it took to load your plugins.