From 4392a58c2298131b1a53db28ebef82e7dad8ef87 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 14 Dec 2022 21:54:17 +0100 Subject: [PATCH] docs: added usage and config --- README.md | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/README.md b/README.md index 322a57a..2cc74c6 100644 --- a/README.md +++ b/README.md @@ -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.