-- Example using a list of specs with the default optionsvim.g.mapleader="" -- Make sure to set `mapleader` before lazy so your mappings are correctvim.g.maplocalleader="\\" -- Same for `maplocalleader`require("lazy").setup({
"folke/which-key.nvim",
{ "folke/neoconf.nvim", cmd="Neoconf" },
"folke/neodev.nvim",
})
โน๏ธ It is recommended to run :checkhealth lazy after installation.
๐ Plugin Spec
Property
Type
Description
[1]
string?
Short plugin url. Will be expanded using config.git.url_format
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 display 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 lazy-loading handlers triggers
enabled
boolean? or fun():boolean
When false, or if the function returns false, then this plugin will not be included in the spec
cond
boolean? or fun(LazyPlugin):boolean
When false, or if the function returns false, then this plugin will not be loaded. Useful to disable some plugins in vscode, or firenvim for example.
dependencies
LazySpec[]
A list of plugin names or plugin specs that should be loaded when the plugin loads. Dependencies are always lazy-loaded unless specified otherwise. When specifying a name, make sure the plugin spec has been defined somewhere else.
init
fun(LazyPlugin)
init functions are always executed during startup
opts
table or fun(LazyPlugin, opts:table)
opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config()
config
fun(LazyPlugin, opts:table) or true
config is executed when the plugin loads. The default implementation will automatically run require(MAIN).setup(opts) if opts or config = true is set. Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. See also opts. To use the default implementation without opts set config to true.
main
string?
You can specify the main module to use for config() and opts(), in case it can not be determined automatically. See config()
build
fun(LazyPlugin) or string or a list of build commands
build is executed when a plugin is installed or updated. Before running build, a plugin is first loaded. If it's a string it will be run as a shell command. When prefixed with : it is a Neovim command. You can also specify a list to executed multiple build commands. Some plugins provide their own build.lua which is automatically used by lazy. So no need to specify a build step for those plugins.
branch
string?
Branch of the repository
tag
string?
Tag of the repository
commit
string?
Commit of the repository
version
string? or false to override the default
Version to use from the repository. Full Semver ranges are supported
pin
boolean?
When true, this plugin will not be included in updates
submodules
boolean?
When false, git submodules will not be fetched. Defaults to true
event
string? or string[] or fun(self:LazyPlugin, event:string[]):string[] or {event:string[]|string, pattern?:string[]|string}
Lazy-load on event. Events can be specified as BufEnter or with a pattern like BufEnter *.lua
cmd
string? or string[] or fun(self:LazyPlugin, cmd:string[]):string[]
Lazy-load on command
ft
string? or string[] or fun(self:LazyPlugin, ft:string[]):string[]
Lazy-load on filetype
keys
string? or string[] or LazyKeysSpec[] or fun(self:LazyPlugin, keys:string[]):(string | LazyKeysSpec)[]
Lazy-load on key mapping
module
false?
Do not automatically load this Lua module when it's required somewhere
priority
number?
Only useful for start plugins (lazy=false) to force loading certain plugins first. Default priority is 50. It's recommended to set this to a high number for colorschemes.
optional
boolean?
When a spec is tagged optional, it will only be included in the final spec, when the same plugin has been specified at least once somewhere else without optional. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins
Lazy Loading
lazy.nvim automagically lazy-loads Lua modules, so it is not needed to
specify module=... everywhere in your plugin specification. This means that if
you have a plugin A that is lazy-loaded and a plugin B that requires a
module of plugin A, then plugin A will be loaded on demand as expected.
If you don't want this behavior for a certain plugin, you can specify that with module=false.
You can then manually load the plugin with :Lazy load foobar.nvim.
You can configure lazy.nvim to lazy-load all plugins by default with config.defaults.lazy = true.
Additionally, you can also lazy-load on events, commands,
file types and key mappings.
Plugins will be lazy-loaded when one of the following is true:
The plugin only exists as a dependency in your spec
It has an event, cmd, ft or keys key
config.defaults.lazy == true
๐ Colorschemes
Colorscheme plugins can be configured with lazy=true. The plugin will automagically load
when doing colorscheme foobar.
NOTE: since start plugins can possibly change existing highlight groups,
it's important to make sure that your main colorscheme is loaded first.
To ensure this you can use the priority=1000 field. (see the examples)
โจ๏ธ Lazy Key Mappings
The keys property can be a string or string[] for simple normal-mode mappings, or it
can be a LazyKeysSpec table with the following key-value pairs:
[1]: (string) lhs (required)
[2]: (string|fun()) rhs (optional)
mode: (string|string[]) mode (optional, defaults to "n")
ft: (string|string[]) filetype for buffer-local keymaps (optional)
any other option valid for vim.keymap.set
Key mappings will load the plugin the first time they get executed.
When [2] is nil, then the real mapping has to be created by the config() function.
-- Example for neo-tree.nvim
{
"nvim-neo-tree/neo-tree.nvim",
keys= {
{ "<leader>ft", "<cmd>Neotree toggle<cr>", desc="NeoTree" },
},
config=function()
require("neo-tree").setup()
end,
}
Versioning
If you want to install a specific revision of a plugin, you can use commit,
tag, branch, version.
*: latest stable version (this excludes pre-release versions)
1.2.x: any version that starts with 1.2, such as 1.2.0, 1.2.3, etc.
^1.2.3: any version that is compatible with 1.2.3, such as 1.3.0, 1.4.5, etc., but not 2.0.0.
~1.2.3: any version that is compatible with 1.2.3, such as 1.2.4, 1.2.5, but not 1.3.0.
>1.2.3: any version that is greater than 1.2.3, such as 1.3.0, 1.4.5, etc.
>=1.2.3: any version that is greater than or equal to 1.2.3, such as 1.2.3, 1.3.0, 1.4.5, etc.
<1.2.3: any version that is less than 1.2.3, such as 1.1.0, 1.0.5, etc.
<=1.2.3: any version that is less than or equal to 1.2.3, such as 1.2.3, 1.1.0, 1.0.5, etc
You can set config.defaults.version = "*" to install the latest stable
version of plugins that support Semver.
Examples
return {
-- the colorscheme should be available when starting Neovim
{
"folke/tokyonight.nvim",
lazy=false, -- make sure we load this during startup if it is your main colorschemepriority=1000, -- make sure to load this before all the other start pluginsconfig=function()
-- load the colorscheme herevim.cmd([[colorscheme tokyonight]])
end,
},
-- I have a separate config.mappings file where I require which-key.-- With lazy the plugin will be automatically loaded when it is required somewhere
{ "folke/which-key.nvim", lazy=true },
{
"nvim-neorg/neorg",
-- lazy-load on filetypeft="norg",
-- options for neorg. This will automatically call `require("neorg").setup(opts)`opts= {
load= {
["core.defaults"] = {},
},
},
},
{
"dstein64/vim-startuptime",
-- lazy-load on a commandcmd="StartupTime",
-- init is called during startup. Configuration for vim plugins typically should be set in an init functioninit=function()
vim.g.startuptime_tries=10end,
},
{
"hrsh7th/nvim-cmp",
-- load cmp on InsertEnterevent="InsertEnter",
-- these dependencies will only be loaded when cmp loads-- dependencies are always lazy-loaded unless specified otherwisedependencies= {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
},
config=function()
-- ...end,
},
-- if some code requires a module from an unloaded plugin, it will be automatically loaded.-- So for api plugins like devicons, we can always set lazy=true
{ "nvim-tree/nvim-web-devicons", lazy=true },
-- you can use the VeryLazy event for things that can-- load later and are not important for the initial UI
{ "stevearc/dressing.nvim", event="VeryLazy" },
{
"Wansmer/treesj",
keys= {
{ "J", "<cmd>TSJToggle<cr>", desc="Join Toggle" },
},
opts= { use_default_keymaps=false, max_join_length=150 },
},
{
"monaqa/dial.nvim",
-- lazy-load on keys-- mode is `n` by default. For more advanced options, check the section on key mappingskeys= { "<C-a>", { "<C-x>", mode="n" } },
},
-- local plugins need to be explicitly configured with dir
{ dir="~/projects/secret.nvim" },
-- you can use a custom url to fetch a plugin
{ url="[email protected]:folke/noice.nvim.git" },
-- local plugins can also be configured with the dev option.-- This will use {config.dev.path}/noice.nvim/ instead of fetching it from GitHub-- With the dev option, you can easily switch between the local and installed version of a plugin
{ "folke/noice.nvim", dev=true },
}
โ๏ธ Configuration
lazy.nvim comes with the following defaults:
{
root=vim.fn.stdpath("data") .."/lazy", -- directory where plugins will be installeddefaults= {
lazy=false, -- should plugins be lazy-loaded?version=nil,
-- default `cond` you can use to globally disable a lot of plugins-- when running inside vscode for examplecond=nil, ---@typeboolean|fun(self:LazyPlugin):boolean|nil-- version = "*", -- enable this to try installing the latest stable versions of plugins
},
-- leave nil when passing the spec as the first argument to setup()spec=nil, ---@typeLazySpeclocal_spec=true, -- load project specific .lazy.lua spec files. They will be added at the end of the spec.lockfile=vim.fn.stdpath("config") .."/lazy-lock.json", -- lockfile generated after running update.---@typenumber? limit the maximum amount of concurrent tasksconcurrency=jit.os:find("Windows") and (vim.uv.available_parallelism() *2) ornil,
git= {
-- defaults for the `Lazy log` command-- log = { "--since=3 days ago" }, -- show commits from the last 3 dayslog= { "-8" }, -- show the last 8 commitstimeout=120, -- kill processes that take more than 2 minutesurl_format="https://github.com/%s.git",
-- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version,-- then set the below to false. This should work, but is NOT supported and will-- increase downloads a lot.filter=true,
},
dev= {
---@typestring | fun(plugin: LazyPlugin): string directory where you store your local plugin projectspath="~/projects",
---@typestring[] plugins that match these patterns will use your local versions instead of being fetched from GitHubpatterns= {}, -- For example {"folke"}fallback=false, -- Fallback to git when local plugin doesn't exist
},
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 startupcolorscheme= { "habamax" },
},
ui= {
-- a number <1 is a percentage., >1 is a fixed sizesize= { width=0.8, height=0.8 },
wrap=true, -- wrap the lines in the ui-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.border="none",
-- The backdrop opacity. 0 is fully opaque, 100 is fully transparent.backdrop=60,
title=nil, ---@typestring only works when border is not "none"title_pos="center", ---@type"center" | "left" | "right"-- Show pills on top of the Lazy windowpills=true, ---@typebooleanicons= {
cmd="๎ฏ ",
config="๏",
event="๎ช ",
ft="๏ ",
init="๏ ",
import="๎ฝ ",
keys="๏ ",
lazy="๓ฐฒ ",
loaded="โ",
not_loaded="โ",
plugin="๏ ",
runtime="๎ ",
require="๓ฐขฑ ",
source="๏ก ",
start="๎ซ ",
task="โ ",
list= {
"โ",
"โ",
"โ ",
"โ",
},
},
-- leave nil, to automatically select a browser depending on your OS.-- If you want to use a specific browser, you can define it herebrowser=nil, ---@typestring?throttle=20, -- how frequently should the ui process render eventscustom_keys= {
-- You can define custom key maps here. If present, the description will-- be shown in the help menu.-- To disable one of the defaults, set it to false.
["<localleader>l"] = {
function(plugin)
require("lazy.util").float_term({ "lazygit", "log" }, {
cwd=plugin.dir,
})
end,
desc="Open lazygit log",
},
["<localleader>t"] = {
function(plugin)
require("lazy.util").float_term(nil, {
cwd=plugin.dir,
})
end,
desc="Open terminal in plugin dir",
},
},
},
diff= {
-- diff command <d> can be one of:-- * browser: opens the github compare view. Note that this is always mapped to <K> as well,-- so you can have a different command for diff <d>-- * git: will run git diff and open a buffer with filetype git-- * terminal_git: will open a pseudo terminal with git diff-- * diffview.nvim: will open Diffview to show the diffcmd="git",
},
checker= {
-- automatically check for plugin updatesenabled=false,
concurrency=nil, ---@typenumber? set to 1 to check for updates very slowlynotify=true, -- get a notification when new updates are foundfrequency=3600, -- check for updates every hourcheck_pinned=false, -- check for pinned packages that can't be updated
},
change_detection= {
-- automatically check for config file changes and reload the uienabled=true,
notify=true, -- get a notification when changes are found
},
performance= {
cache= {
enabled=true,
},
reset_packpath=true, -- reset the package path to improve startup timertp= {
reset=true, -- reset the runtime path to $VIMRUNTIME and your config directory---@typestring[]paths= {}, -- add any custom paths here that you want to includes in the rtp---@typestring[] list any plugins you want to disable heredisabled_plugins= {
-- "gzip",-- "matchit",-- "matchparen",-- "netrwPlugin",-- "tarPlugin",-- "tohtml",-- "tutor",-- "zipPlugin",
},
},
},
-- lazy can generate helptags from the headings in markdown readme files,-- so :help works even for plugins that don't have vim docs.-- when the readme opens with :help it will be correctly displayed as markdownreadme= {
enabled=true,
root=vim.fn.stdpath("state") .."/lazy/readme",
files= { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docsskip_if_doc_exists=true,
},
state=vim.fn.stdpath("state") .."/lazy/state.json", -- state info for checker and other thingsbuild= {
-- Plugins can provide a `build.lua` file that will be executed when the plugin is installed-- or updated. When the plugin spec also has a `build` command, the plugin's `build.lua` not be-- executed. In this case, a warning message will be shown.warn_on_override=true,
},
-- Enable profiling of lazy.nvim. This will add some overhead,-- so only enable this when you are debugging lazy.nvimprofiling= {
-- Enables extra stats on the debug tab related to the loader cache.-- Additionally gathers stats about all package.loadersloader=false,
-- Track each new require in the Lazy profiling tabrequire=false,
},
}
If you don't want to use a Nerd Font, you can replace the icons with Unicode symbols.
Plugins are managed with the :Lazy command.
Open the help with <?> to see all the key mappings.
You can press <CR> on a plugin to show its details. Most properties
can be hovered with <K> to open links, help files, readmes,
git commits and git issues.
Lazy can automatically check for updates in the background. This feature
can be enabled with config.checker.enabled = true.
Any operation can be started from the UI, with a sub command or an API function:
Command
Lua
Description
:Lazy build {plugins}
require("lazy").build(opts)
Rebuild a plugin
:Lazy check [plugins]
require("lazy").check(opts?)
Check for updates and show the log (git fetch)
:Lazy clean [plugins]
require("lazy").clean(opts?)
Clean plugins that are no longer needed
:Lazy clear
require("lazy").clear()
Clear finished tasks
:Lazy debug
require("lazy").debug()
Show debug information
:Lazy health
require("lazy").health()
Run :checkhealth lazy
:Lazy help
require("lazy").help()
Toggle this help page
:Lazy home
require("lazy").home()
Go back to plugin list
:Lazy install [plugins]
require("lazy").install(opts?)
Install missing plugins
:Lazy load {plugins}
require("lazy").load(opts)
Load a plugin that has not been loaded yet. Similar to :packadd. Like :Lazy load foo.nvim. Use :Lazy! load to skip cond checks.
:Lazy log [plugins]
require("lazy").log(opts?)
Show recent updates
:Lazy profile
require("lazy").profile()
Show detailed profiling
:Lazy reload {plugins}
require("lazy").reload(opts)
Reload a plugin (experimental!!)
:Lazy restore [plugins]
require("lazy").restore(opts?)
Updates all plugins to the state in the lockfile. For a single plugin: restore it to the state in the lockfile or to a given commit under the cursor
:Lazy sync [plugins]
require("lazy").sync(opts?)
Run install, clean and update
:Lazy update [plugins]
require("lazy").update(opts?)
Update plugins. This will also update the lockfile
Any command can have a bang to make the command wait till it finished. For example,
if you want to sync lazy from the cmdline, you can use:
nvim --headless "+Lazy! sync" +qa
opts is a table with the following key-values:
wait: when true, then the call will wait till the operation completed
show: when false, the UI will not be shown
plugins: a list of plugin names to run the operation on
concurrency: limit the number of concurrently running tasks
Stats API (require("lazy").stats()):
{
-- startuptime in milliseconds till UIEnterstartuptime=0,
-- when true, startuptime is the accurate cputime for the Neovim process. (Linux & macOS)-- this is more accurate than `nvim --startuptime`, and as such will be slightly higher-- when false, startuptime is calculated based on a delta with a timestamp when lazy started.real_cputime=false,
count=0, -- total number of pluginsloaded=0, -- number of loaded plugins---@typetable<string, number>times= {},
}
lazy.nvim provides a statusline component that you can use to show the number of pending updates.
Make sure to enable config.checker.enabled = true to make this work.
LazyDone: when lazy has finished starting up and loaded your config
LazySync: after running sync
LazyInstall: after an install
LazyUpdate: after an update
LazyClean: after a clean
LazyCheck: after checking for updates
LazyLog: after running log
LazyLoad: after loading a plugin. The data attribute will contain the plugin name.
LazySyncPre: before running sync
LazyInstallPre: before an install
LazyUpdatePre: before an update
LazyCleanPre: before a clean
LazyCheckPre: before checking for updates
LazyLogPre: before running log
LazyReload: triggered by change detection after reloading plugin specs
VeryLazy: triggered after LazyDone and processing VimEnter auto commands
LazyVimStarted: triggered after UIEnter when require("lazy").stats().startuptime has been calculated.
Useful to update the startuptime on your dashboard.
๐ Lockfile lazy-lock.json
After every update, the local lockfile is updated with the installed revisions.
It is recommended to have this file under version control.
If you use your Neovim config on multiple machines, using the lockfile, you can
ensure that the same version of every plugin is installed.
If you are on another machine, you can do :Lazy restore, to update all your plugins to
the version from the lockfile.
โก Performance
Great care has been taken to make the startup code (lazy.core) as efficient as possible.
During startup, all Lua files used before VimEnter or BufReadPre are byte-compiled and cached,
similar to what impatient.nvim does.
My config for example loads in about 11ms with 93 plugins. I do a lot of lazy-loading though :)
lazy.nvim comes with an advanced profiler :Lazy profile to help you improve performance.
The profiling view shows you why and how long it took to load your plugins.
๐ Debug
See an overview of active lazy-loading handlers and what's in the module cache.
โถ๏ธ Startup Sequence
lazy.nvim does NOT use Neovim packages and even disables plugin loading
completely (vim.go.loadplugins = false). It takes over the complete
startup sequence for more flexibility and better performance.
All plugins with lazy=false are loaded. This includes sourcing /plugin and /ftdetect files. (/after will not be sourced yet)
All files from /plugin and /ftdetect directories in your rtp are sourced (excluding /after)
All /after/plugin files are sourced (this includes /after from plugins)
Files from runtime directories are always sourced in alphabetical order.
๐ Structuring Your Plugins
Some users may want to split their plugin specs in multiple files.
Instead of passing a spec table to setup(), you can use a Lua module.
The specs from the module and any top-level sub-modules will be merged together in the final spec,
so it is not needed to add require calls in your main plugin file to the other files.
The benefits of using this approach:
Simple to add new plugin specs. Just create a new file in your plugins module.
Allows for caching of all your plugin specs. This becomes important if you have a lot of smaller plugin specs.
Spec changes will automatically be reloaded when they're updated, so the :Lazy UI is always up to date.
Example:
~/.config/nvim/init.lua
require("lazy").setup("plugins")
~/.config/nvim/lua/plugins.lua or ~/.config/nvim/lua/plugins/init.lua(this file is optional)
When you import specs, you can override them by simply adding a spec for the same plugin to your local
specs, adding any keys you want to override / merge.
opts, dependencies, cmd, event, ft and keys are always merged with the parent spec.
Any other property will override the property from the parent spec.
config=function(plugin)
vim.opt.rtp:append(plugin.dir.."/custom-rtp")
end
With packer wants, requires and after can be used to manage dependencies.
With lazy, this isn't needed for most of the Lua dependencies. They can be installed just like normal plugins
(even with lazy=true) and will be loaded when other plugins need them.
The dependencies key can be used to group those required plugins with the one that requires them.
The plugins which are added as dependencies will always be lazy-loaded and loaded when the plugin is loaded.
To uninstall lazy.nvim, you need to remove the following files and directories:
data: ~/.local/share/nvim/lazy
state: ~/.local/state/nvim/lazy
lockfile: ~/.config/nvim/lazy-lock.json
Paths can differ if you changed XDG environment variables.
๐ Highlight Groups
Click to see all highlight groups
Highlight Group
Default Group
Description
LazyButton
CursorLine
LazyButtonActive
Visual
LazyComment
Comment
LazyCommit
@variable.builtin
commit ref
LazyCommitIssue
Number
LazyCommitScope
Italic
conventional commit scope
LazyCommitType
Title
conventional commit type
LazyDimmed
Conceal
property
LazyDir
@markup.link
directory
LazyH1
IncSearch
home button
LazyH2
Bold
titles
LazyLocal
Constant
LazyNoCond
DiagnosticWarn
unloaded icon for a plugin where cond() was false
LazyNormal
NormalFloat
LazyProgressDone
Constant
progress bar done
LazyProgressTodo
LineNr
progress bar todo
LazyProp
Conceal
property
LazyReasonCmd
Operator
LazyReasonEvent
Constant
LazyReasonFt
Character
LazyReasonImport
Identifier
LazyReasonKeys
Statement
LazyReasonPlugin
Special
LazyReasonRequire
@variable.parameter
LazyReasonRuntime
@macro
LazyReasonSource
Character
LazyReasonStart
@variable.member
LazySpecial
@punctuation.special
LazyTaskError
ErrorMsg
task errors
LazyTaskOutput
MsgArea
task output
LazyUrl
@markup.link
url
LazyValue
@string
value of a property
๐ Plugin Authors
If your plugin needs a build step, you can create a file build.lua or build/init.lua
in the root of your repo. This file will be loaded when the plugin is installed or updated.
This makes it easier for users, as they no longer need to specify a build command.
Describe the bug
I get this error on startup for all the local plugins (as new) in combination with always the same plugin as old.
If I remove the plugin then just another one is the old one.
Which version of Neovim are you using?
NVIM v0.9.0-dev-525+ga7332ba9b
Expected Behavior
No errors
Screenshots
Log
Please include any related errors from the Noice log file. (open with :Lazy log)
Breaking Changes (1)
โ lazy.nvim 56170.32ms ๏ก init.lua
3c3a711 chore(build): auto-generate vimdoc (67 minutes ago)
44f80a7 feat(plugin): allow plugin files only without a main plugin module. Fixes #53 (68 minutes ago)
f5734f5 chore(build): auto-generate vimdoc (2 hours ago)
3814883 fix(ui): set current win only when its valid (2 hours ago)
3a7b8c8 chore(main): release 5.1.0 (#30) (11 hours ago)
3606d62 fix: add after directories to rtp to make after/ftplugin and others work. Fixes #47 (11 hours ago)
b193f96 fix(spec): only process a spec once (11 hours ago)
7be46bc style: removed unused requires (12 hours ago)
897d6df fix: add filetype to window buffer. (#41) (13 hours ago)
14300b3 chore(build): auto-generate vimdoc (13 hours ago)
78e9d6c docs: add a note about mapleader (13 hours ago)
06ac8bd perf(ui): clear existing extmarks before rendering (13 hours ago)
ffcd0ab fix(loader): source filetype.lua before plugins. Fixes #35 (14 hours ago)
9d12cdc fix(git): don't run git log for submodules. Fixes #33 (14 hours ago)
06ffcf5 chore(build): auto-generate vimdoc (14 hours ago)
7fb0652 docs: added docs on update checker (14 hours ago)
1f86cb3 chore(build): auto-generate vimdoc (15 hours ago)
3cffb2a docs: added change detection to the readme (15 hours ago)
6c767a6 feat: added options to configure change detection. Fixes #32 (15 hours ago)
cd162f3 chore(build): auto-generate vimdoc (15 hours ago)
941df31 feat(ui): make the windoww size configurable. Fixes #34 (15 hours ago)
5298441 fix: use nvim_feekeys instead of nvim_input for keys handler. Fixes #28 (16 hours ago)
2927b05 docs: added lincense (16 hours ago)
4d78203 chore(main): release 5.0.1 (#17) (17 hours ago)
1371a14 fix(build): use the shell to execute build commands (17 hours ago)
ffabe91 fix(cache): if mod is loaded already in the loader, then return that (18 hours ago)
316503f fix: dont autoload cached modules when module=false (18 hours ago)
992c679 fix: always set Config.me regardless of reset rtp (18 hours ago)
df6c986 fix: add neovim libs to rtp for treesitter parsers etc (19 hours ago)
49b69b7 chore(build): auto-generate vimdoc (20 hours ago)
e9d3a73 fix: default logs are now since 3 days ago to be in line with the docs (20 hours ago)
4234322 chore(build): auto-generate vimdoc (20 hours ago)
6e32759 fix: deepcopy lazyspec before processing (20 hours ago)
ec0f8d0 docs: added config.dev.path to the example (20 hours ago)
6404d42 fix: move re-sourcing check to the top (20 hours ago)
ddf36d7 fix: checker should not error on non-existing dirs (20 hours ago)
50ba619 test: fix tests (21 hours ago)
f78d8bf fix: show error when merging, but continue (21 hours ago)
b8a0055 chore(build): auto-generate vimdoc (22 hours ago)
1754056 fix: use jobstart instead of system to open urls (22 hours ago)
5ecc988 docs: use https to bootstrap lazy (22 hours ago)
ae644a6 fix: only run updated checker for installed plugins. Fixes #16 (22 hours ago)
7225b05 chore(build): auto-generate vimdoc (23 hours ago)
17fd57a docs: added docs for statusline and count (23 hours ago)
48a596e chore(build): auto-generate vimdoc (23 hours ago)
dfe8a65 docs: removed extra performance section (23 hours ago)
1fa2d87 docs: moved my dots to structuring plugins (23 hours ago)
9916318 chore(build): auto-generate vimdoc (23 hours ago)
abe026a docs: added section on performance (23 hours ago)
82aea47 chore(build): auto-generate vimdoc (24 hours ago)
72d66cd docs: updated lua stuff (24 hours ago)
ca43018 chore(build): auto-generate vimdoc (24 hours ago)
36cb7ea docs: migration guide (24 hours ago)
2f59ead chore(main): release 5.0.0 (#12) (24 hours ago)
dbcf675 chore(build): auto-generate vimdoc (24 hours ago)
b906ad9 docs: added windows to supported platforms (24 hours ago)
cb87aa3 ci: run tests on linux only for nw (25 hours ago)
75a36f3 chore(build): auto-generate vimdoc (25 hours ago)
af87108 fix(util): fixed double slashes (25 hours ago)
62c1542 fix(cache): normalize paths (26 hours ago)
bb1c2f4 feat: added support for Windows (27 hours ago)
198963f feat: utility method to normalize a path (27 hours ago)
a189883 fix: check for installed plugins with plain find (27 hours ago)
833b387 chore(build): auto-generate vimdoc (2 days ago)
ff89319 docs: removed dots from features (2 days ago)
b7bf18a style: spelling (2 days ago)
66dad89 chore(build): auto-generate vimdoc (2 days ago)
0c0b8b7 docs: todo (2 days ago)
92fd0d4 docs: updated installation and structuring plugins (2 days ago)
1baa92f docs: added docs on <cr> and <K> (2 days ago)
d827d8a docs: collapse semver examples (2 days ago)
1e16363 chore(build): auto-generate vimdoc (2 days ago)
980cfa9 docs: added config example when not using a Nerd Font (2 days ago)
713dcb6 build: added markdownlint config (2 days ago)
706fe6f chore(build): auto-generate vimdoc (2 days ago)
5ed9855 feat: added completion for all lazy commands (2 days ago)
b462787 docs: added optional plugins to docs for commands and methods (2 days ago)
f29f3d2 chore(build): auto-generate vimdoc (2 days ago)
1efa710 feat: added module=false to skip auto-loading of plugins on require (2 days ago)
55d194c chore(build): auto-generate vimdoc (2 days ago)
bac34cc docs: added section on uninstalling (2 days ago)
c065ca2 chore(build): auto-generate vimdoc (2 days ago)
2dd6230 feat: added :Lazy load foobar.nvim to load a plugin (2 days ago)
8a0da3b config: move lazy cache to state/nvim/lazy/cache (2 days ago)
7eb6034 chore(build): auto-generate vimdoc (2 days ago)
6567580 chore: todo (2 days ago)
6f00cde docs: typos (2 days ago)
faac2dd perf(cache): cache loadfile and no find modpaths without package.loaders (2 days ago)
32f2b71 fix(cache): do a fast check to see if a cached modpath is still valid. find it again otherwise (2 days ago)
1fe43f3 fix(ui): focus Lazy window when auto-installing plugins in VimEnter (2 days ago)
d4aee27 feat!: removed the LazyUpdate etc commands. sub-commands only from now on (2 days ago)
b89e6bf perf: lazy-load the commands available on the lazy module (3 days ago)
48309dd chore(main): release 4.2.0 (#11) (3 days ago)
c87673c feat(ui): added help for on a plugin (3 days ago)
b88b7d7 chore(build): auto-generate vimdoc (3 days ago)
e42a180 docs: added line on :checkhealth (3 days ago)
2526a01 chore(build): auto-generate vimdoc (3 days ago)
968fa3f style: removed bold from home button (3 days ago)
5fc87f9 docs: updated screenshots (3 days ago)
cd3d87c chore(build): auto-generate vimdoc (3 days ago)
d0651e4 docs: added section about the lockfile (3 days ago)
39f629e chore(build): auto-generate vimdoc (3 days ago)
628d421 docs: added my dots to the examples (3 days ago)
c88ad91 docs: added section on versioning (3 days ago)
78b284c docs: added section on lazy loading (3 days ago)
c0d3617 feat: check if ffi is available and error if not (3 days ago)
0f62ec0 chore(build): auto-generate vimdoc (3 days ago)
b70bb19 docs: added more detailed requirements (3 days ago)
db469ed chore(build): auto-generate vimdoc (3 days ago)
671b163 docs: added more details on startup sequence (3 days ago)
1730661 docs: generate docs for commands (3 days ago)
f25f942 feat: expose all commands on main lazy module (3 days ago)
Log (11)
โ LuaSnip 67.66ms ๏ nvim-cmp
5570fd7 Auto generate docs (13 hours ago)
618b945 log: don't print a message on every start, provide log.ping() instead. (13 hours ago)
โ gitsigns.nvim
2ab3bdf fix(blame): #697 (2 days ago)
โ neodev.nvim 8.8ms ๏ nvim-lspconfig
c5f0a81 chore: auto-generated types for Neovim nightly (3 hours ago)
f8b17d3 chore: auto-generated types for Neovim nightly (27 hours ago)
โ noice.nvim 1.42ms ๎ฏ LazyLoad
e4a4290 chore(build): auto-generate vimdoc (2 days ago)
29a2e05 feat: added `Filter.cond` to conditionally use a route (2 days ago)
7dac8ce chore(build): auto-generate vimdoc (3 days ago)
c9c1fbd fix: correctly apply padding based on four numbers (3 days ago)
โ nui.nvim 0.1ms ๏ noice.nvim
b12db53 fix(layout): process split layout box change (4 hours ago)
51721a4 fix(layout): process float layout box change (4 hours ago)
96ef1cb feat(split): store id internally (4 hours ago)
โ nvim-dap 4.04ms ๎ฏ LazyLoad ๏ rust-tools.nvim
284c754 Stop resizing widgets if converted to non-float window (2 days ago)
3971d9b Allow opening multiple frames or scopes widgets (2 days ago)
โ nvim-lspconfig 20.69ms ๎ฏ LazyLoad
5292d60 docs: update server_configurations.md skip-checks: true (7 hours ago)
f70a094 fix: rename ruff-lsp to ruff_lsp (#2337) (7 hours ago)
80e81b1 docs: update server_configurations.md skip-checks: true (7 hours ago)
d8a4493 chore: remove `languageFeatures`, `documentFeatures` (#2336) (7 hours ago)
baab771 docs: update server_configurations.md skip-checks: true (8 hours ago)
4e13145 feat: add ruff-lsp support (#2335) (8 hours ago)
d597b0f fix: send the lsp method request after insert workspace folders (#2330) (27 hours ago)
1ab2720 docs: update server_configurations.md skip-checks: true (27 hours ago)
9c70f37 feat: add jq support (#2333) (27 hours ago)
259729c docs: update server_configurations.md skip-checks: true (29 hours ago)
aa22008 feat: add uvl support (#2331) (29 hours ago)
dd9e7f9 fix(gdscript): support get the port from env variable (#2313) (31 hours ago)
22c87d6 build(rockspec): fix rockspec package name (2 days ago)
โ nvim-treesitter 10.2ms ๏ nvim-treesitter-refactor
eedb7b9 csharp: update query to parser change (26 hours ago)
8498ebd Update parsers: c_sharp, jsonnet, query (26 hours ago)
6e37050 Update parsers: swift (2 days ago)
a75aded highlights(java): fix '!',param,global group (2 days ago)
โ nvim-treesitter-textobjects 1.69ms ๎ฏ LazyLoad
e2ee8fd ci: bump stylua version (3 days ago)
โ playground 0.98ms ๎ฏ LazyLoad ๏ nvim-treesitter
3421bbb ci: bump action versions (3 days ago)
โ telescope.nvim
d16581e fix: misidentification invert and files_with_matches (#2240) (#2262) (78 minutes ago)
278c797 fix(builtin.live_grep): add spacer ":" even when coordinates disabled (#2275) (79 minutes ago)
I am getting the above error everytime I open neovim, I've tried reinstalling everything, update, and sync.
Neovim Version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.1/share/nvim"
Run :checkhealth for more info
To Reproduce
Steps to reproduce the behavior:
I haven't put much time in making a minimal reproducible config, but I believe it is because I have added plenary.nvim as a dependency for multiple plugins.
Is your feature request related to a problem? Please describe.
I use cheovim and it doesn't work because only my config folder but not ~/.config/nvim is added to runtime path.
Describe the solution you'd like
allow adding some directories manually to runtime path
Describe alternatives you've considered
don't use cheovim
(would be really sad)
for me it isn't clear whether the function can load multiple plugins at once (with a table or multiple arguments) or not
especially because it's written in plural and in singular form
(forgive me for opening this issue, I don't had yet the time to migrate so I couldn't test)
Is your feature request related to a problem? Please describe.
I'm porting my nvim config to lazy and am getting the "Config Change Detected. Reloading..." notification on every safe. I save a lot.
Describe the solution you'd like
An option that disables the notification and just updates the lazy index silently.
there is this part of the readme which say that you can basically have all your plugins in some files in the same folder.
I wonder how the performance of this is in comparison to just pass all the plugin specs directly to the function
since when you do the first one there are (depending on how many plugins you have) quite a few require calls to be made. Also all the stuff inside the files is loaded then.
First of all thank you again for yet another great and solid work!
I am getting an exception while loading colorschemes if the instructions for it come from vimscript runtime paths (allegedly not if setting the option in init.lua). I have created a minimally reproducible neovim configuration as follows:
โโโ lua
โ โโโ plugins.lua
โโโ plugin <-- this is standard vim runtime path
โ โโโ settings.vim
โโโ init.lua
with the corresponding lua/plugins.lua file containing the list of plugins to load, as per your example
return {
'folke/tokyonight.nvim'
}
Now if I activate the colorscheme adding, in plugin/settings.vim
colorscheme tokyonight
I get an exception from this line and the colorscheme does not load (even if I manually set it within neovim with :colorscheme tokyonight). Viceversa, if I instead append vim.cmd[[colorscheme tokyonight]] to init.lua (after loading lazy.nvim) then all is good.
TL;DR colorschemes are only applied if instructed so in init.lua, not so if the instruction is given through standard vim runtime path plugin/<something>.vim
P. S. You may be asking why I still give the instruction via vimscript files: it is because I am currently using VimPlug and with it most settings are more easily set still via vimscript.
Describe the bug
After installing mason-null-ls.nvim, I tried using Lazy's feature of generating help tags when no are present in a plugin. While :help mason-null-ls<tab> shows plenty, which correlate perfectly with the headers in its README, one can't open them: "Tag not found: mason-null-ls.nvim-setup@en". Notably, that "@en" isn't present in the completions.
`mason-null-ls` bridges `mason.nvim` with the `null-ls` plugin - making it easier to use both plugins together.
# Introduction
`mason-null-ls.nvim` closes some gaps that exist between `mason.nvim` and `null-ls`. Its main responsibilities are:
- provide extra convenience APIs such as the `:NullLsInstall` command
- allow you to (i) automatically install, and (ii) automatically set up a predefined list of sources
- translate between `null-ls` source names and `mason.nvim` package names (e.g. `haml_lint` <-> `haml-lint`)
It is recommended to use this extension if you use `mason.nvim` and `null-ls`.
Please read the whole README.md before jumping to [Setup](#setup).
**Note: this plugin uses the `null-ls` source names in the APIs it exposes - not `mason.nvim` package names.
# Requirements
- neovim `>= 0.7.0`
- [`mason.nvim`](https://github.com/williamboman/mason.nvim)
- [`null-ls.nvim`](https://github.com/jose-elias-alvarez/null-ls.nvim)
# Installation
## [Packer](https://github.com/wbthomason/packer.nvim)
```lua
use {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
"jayp0521/mason-null-ls.nvim",
}
```
## vim-plug
```vim
Plug 'williamboman/mason.nvim'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'jayp0521/mason-null-ls.nvim'
```
# Commands
Available after calling `setup`.
- `:NullInstall [...]` - installs the provided sources
- `:NullUninstall ...` - uninstalls the provided sources
# Configuration
You may optionally configure certain behavior of `mason-null-ls.nvim` when calling the `.setup()` function. Refer to
the [default configuration](#default-configuration) for a list of all available settings.
Example:
```lua
require("mason-null-ls").setup({
ensure_installed = { "stylua", "jq" }
})
```
## Default configuration
```lua
local DEFAULT_SETTINGS = {
-- A list of sources to install if they're not already installed.
-- This setting has no relation with the `automatic_installation` setting.
ensure_installed = {},
-- Run `require("null-ls").setup`.
-- Will automatically install masons tools based on selected sources in `null-ls`.
-- Can also be an exclusion list.
-- Example: `automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }`
automatic_installation = false,
-- Whether sources that are installed in mason should be automatically set up in null-ls.
-- Removes the need to set up null-ls manually.
-- Can either be:
-- - false: Null-ls is not automatically registered.
-- - true: Null-ls is automatically registered.
-- - { types = { SOURCE_NAME = {TYPES} } }. Allows overriding default configuration.
-- Ex: { types = { eslint_d = {'formatting'} } }
automatic_setup = false,
}
```
# Automatic Setup Usage
Automatic Setup is a need feature that removes the need to configure `null-ls` for supported sources.
Sources found installed in `mason` will automatically be setup for null-ls.
## Example Config
```lua
require("mason").setup()
require("mason-null-ls").setup({
automatic_setup = true,
})
```
See the Default Configuration section to understand how the default dap configs can be overriden.
# Setup handlers usage
The `setup_handlers()` function provides a dynamic way of setting up sources and any other needed logic, It can also do that during runtime.
**NOTE:** When setting `automatic_setup = true`, the handler function needs to be called at a minimum like:
`require 'mason-null-ls'.setup_handlers()`. When passing in a custom handler function for the the default or a source,
then the automatic_setup function one won't be invoked. See below to keep original functionality inside the custom handler.
```lua
local null_ls = require 'null-ls'
require ('mason-null-ls').setup({
ensure_installed = {'stylua', 'jq'}
})
require 'mason-null-ls'.setup_handlers {
function(source_name, methods)
-- all sources with no handler get passed here
end,
stylua = function(source_name, methods)
null_ls.register(null_ls.builtins.formatting.stylua)
end,
}
-- will setup any installed and configured sources above
null_ls.setup()
```
# Setup
There are primarily 2 paths to setup.
## Primary Source of Truth is `mason-null-ls`
This involves making sure tools are installed through `mason-null-ls` when available.
```lua
require("mason").setup()
require("mason-null-ls").setup({
ensure_installed = {
-- Opt to list sources here, when available in mason.
},
automatic_installation = false,
automatic_setup = true, -- Recommended, but optional
})
require("null-ls").setup(
sources = {
-- Anything not supported by mason.
}
)
require 'mason-null-ls'.setup_handlers() -- If `automatic_setup` is true.
```
## Primary Source of Truth is `null-ls`.
```lua
require("mason").setup()
require("null-ls").setup(
sources = {
-- all sources go here.
}
)
require("mason-null-ls").setup({
ensure_installed = nil,
automatic_installation = true,
automatic_setup = false,
})
```
Note: This is my personal preference.
# Available Null-ls sources
| Filetype | Source name |
|---------------------------------------------------------------------------------------------------------------------------------------|------------------------|
| blade | `blade_formatter` |
| bzl | `buildifier` |
| c cpp | `cpplint` |
| c cpp cs java cuda | `clang_format` |
| clj | `joker` |
| cs | `csharpier` |
| django jinja.html htmldjango | `djlint` |
| dockerfile | `hadolint` |
| elm | `elm_format` |
| eruby | `erb_lint` |
| gitcommit | `gitlint` |
| go | `gofumpt` |
| go | `goimports` |
| go | `goimports_reviser` |
| go | `golangci_lint` |
| go | `golines` |
| go | `revive` |
| go | `staticcheck` |
| haml | `haml_lint` |
| javascript typescript | `rome` |
| javascript javascriptreact typescript typescriptreact | `xo` |
| javascript javascriptreact typescript typescriptreact vue | `eslint_d` |
| javascript javascriptreact typescript typescriptreact vue css scss less html json jsonc yaml markdown markdown.mdx graphql handlebars | `prettier` |
| javascript javascriptreact typescript typescriptreact vue css scss less html json jsonc yaml markdown markdown.mdx graphql handlebars | `prettierd` |
| jinja.html htmldjango | `curlylint` |
| json | `fixjson` |
| json | `jq` |
| kotlin | `ktlint` |
| lua | `luacheck` |
| lua | `selene` |
| lua | `stylua` |
| markdown | `alex` |
| markdown | `markdownlint` |
| markdown | `write_good` |
| markdown org | `cbfmt` |
| markdown tex | `proselint` |
| markdown tex asciidoc | `vale` |
| php | `phpcbf` |
| php | `psalm` |
| proto | `buf` |
| proto | `protolint` |
| python | `autopep8` |
| python | `black` |
| python | `blue` |
| python | `flake8` |
| python | `isort` |
| python | `mypy` |
| python | `pylint` |
| python | `vulture` |
| python | `yapf` |
| ruby | `rubocop` |
| ruby | `standardrb` |
| sh | `shellcheck` |
| sh | `shellharden` |
| sh | `shfmt` |
| solidity | `solhint` |
| sql | `sqlfluff` |
| sql | `sql_formatter` |
| toml | `taplo` |
| vim | `vint` |
| yaml | `actionlint` |
| yaml | `yamlfmt` |
| yaml | `yamllint` |
| yaml json | `cfn_lint` |
| | `codespell` |
| | `cspell` |
| | `editorconfig_checker` |
| | `misspell` |
| | `textlint` |
Is there any way to check the code that was introduced by a plugin's update?
Something equivalent to packer's d ?
For instance, I tried now to check what code was introduced after the latest commit that fixed the other issue, but the only thing I could find in the docs was the gl command which only shows the commit details but not the code (i.e. git diff).
Would be really nice to have some kind of a floating window to show the git diff command.
Describe the bug
this plugin: https://github.com/kevinhwang91/nvim-bqf
does not work when installed from lazy.
from packer it works as expected.
I would love to help debug it, I created 2 minimal configs, where with the packer one the plugin is working
Which version of Neovim are you using?
Gui(specify which GUI client you are using)? Nightly? Version?
NVIM v0.9.0-dev-530+gde90a8bfe
Packer
packer-minimal-init.lua
local on_windows = vim.loop.os_uname().version:match("Windows")
local function join_paths(...)
local path_sep = on_windows and "\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end
local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"
vim.opt.grepprg = "rg --vimgrep"
local package_root = join_paths(temp_dir, 'nvim', 'site', 'pack')
local lazypath = join_paths(temp_dir, 'nvim', 'site') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'--single-branch',
'https://github.com/folke/lazy.nvim.git',
lazypath,
}
end
vim.opt.runtimepath:prepend(lazypath)
Is your feature request related to a problem? Please describe.
I have a bad habit of mapping K to 10gk, but I am too deep down the rabbit hole to go back. It is a bit painful that K is mapped by default in the lazy popup window overwriting my mapping of K.
Describe the solution you'd like
Customisable keymaps in the lazy popup window. For me, only being able to map K to something else would be great, but I think it would be awesome to customise all keymaps in the popup window.
Describe alternatives you've considered
I don't really know of another way to map the behaviour of K to another key while still having my original mapping of K. I want to maybe map it to gd for example instead of K.
Is your feature request related to a problem? Please describe.
lazy.nvim can cause the nvim process to use up 1-2 GB of RAM during the first initialization.
This caused my dusty old PC to lock up for a few minutes. I've set concurrency to 5, so I don't think git is the cause.
After closing the Lazy popup window, the memory is instantly freed. Memory usage of the syncs afterwards is normal (so far).
I've never had this problem with packer. What is causing this high memory consumption?
Describe the solution you'd like
A more efficient RAM usage during the first startup.
Describe alternatives you've considered
I think this can be somewhat achieved using manual mappings in init = ..., but something more declarative would be nice.
Describe the bug
I have an issue that my configs in /after/plugin/* are not loaded.
Which version of Neovim are you using?
VIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.8.1/share/nvim"
Run :checkhealth for more info
To Reproduce
Steps to reproduce the behavior:
Clone github.com/rgruyters/nvim.git
checkout branch feature/lazy
start Neovim (nvim)
Expected Behavior
For example, bufferline should be working, Telescope keymaps (ff) should be working, etc.
Screenshots
If applicable, add screenshots to help explain your problem.
I think the installation section, specifically the loading part, could use an
extra sentence or two. I was confused on what config.plugins was initially.
Maybe a quick, "for example, if you have a lua file ~/.config/nvim/lua/config/plugins.lua that returns a table" or something it'd
remove most question marks I think.
When autoinstalling the plugins the cursor isn't focused on the floating
window, but on the non-floating window in the background.
Doing :Lazy clean doesn't show which plugins were removed.
Shouldn't the "Versioning" section be in the "Lockfile" chapter?
Why are personal dotfiles used as examples? Dotfiles change all the time,
there's no guarantee this will be relevant or even exist in two years.
What's the difference between lazy-loading and verylazy-loading?
Most emojis in "Configuration" aren't shown for me.
add section on how to uninstall
add :Packadd command or something similar
Typos:
automcatilly check for plugin updates
A custom name for the plugin used for the local plugin directory and as the dispay name
local plugins need to be explicitely configured with dir
Nitpicks:
Bootstrap code is unevenly indented.
"Works on Linux, MacOS and Windows" lol just remove this line, it's not needed anymore.
I'm really excited to try lazy.nvim, it seems to be what I've been looking for and it saved me the trouble of doing it myself!
I was wondering if you thought about adding support for using rocks at some point. From what I understand some Neovim core maintainers were looking to make a standard using luarocks to host the plugins and their specs (dependencies, etc) to make everything easier to maintain for the end users, and I'm also working on a full incremental rewrite of rest.nvim which will need a rock in order to work.
If it's not in the plans, do you know of a way to do it on my own?
Describe the solution you'd like
Would you consider supporting a string instead of a function, i.e. config = "plugins.treesitter"? This would just be syntactic sugar for the code above.
This is similar to the setup function which allows both a table and a module name that gets loaded instead. And imo it looks cleaner when you move a lot of your config to other files.
Describe alternatives you've considered
None
Additional context
Great work, I'm really enjoying the new features and love the way the config looks with lazy.nvim!
For nvim-tree to show up for example, I have to type leaderk once for it to be internally loaded by lazy.nvim it seems, only then, typing again leaderk will bring the nvim-tree window up.
I have the same behavior replicated for most other plugins I load by keys.
Is your feature request related to a problem? Please describe. nvim-tressitter (and other extendible plugins) has tons of modules
and each module has basically the following form, if you want to add it to your
plugin-list:
include (or any other name) should install the given list of plugins if and only if the plugin above is installed as well!
This removes the requirement to add the same dependency again and again for each
module.
Describe alternatives you've considered
Write each plugin with "dependencies" as above.
Write everything down and assume that treesitter is always installed:
The current lazy option is not exactly analogous to packer's opt, which (if not implied by other lazy-loading options like cmd or module1) does not put the plugin in runtimepath unless explicitly packadded.
This is useful for me for keeping nvim-treesitter around for testing but preventing it to be pulled in by other plugins who are eager to use it if available, which currently doesn't seem to be possible with Lazy.
So my suggestion is to add a new option manual for plugins that are not lazy-loaded and only explicitly via, e.g., :Lazy load.
1which as far as I can tell is the closer analogue to `lazy`, in fact
In packer we have 2 options to define sequencing. First is require which analogous to dependencies in lazy.nvim.
Another is after, which looks like
use { "pluginA" }
use {
"pluginB",
after = "pluginA"
}
Is there any alternative to for "after" option ?
I tried to used dependencies, and it gave some merging plugins not supported error.
Also, dependencies will load "pluginA", but after will load only after "pluginB" is loaded, so pluginA loading takes a preference here
it would be cool if you could have named snapshots to which you can "revert" your plugins
this would basically just be an extension to the lockfiles I guess.
You'd be able to have multiple lockfiles and can restore the state from one of them
Currently, the plugin spec build runs every time you run :Lazy update. iirc, with packer, the equivalent run only did so when there has been actually has been an update to the plugin.
Note sure whether this is intended, but I think it would make sense to run build only when there actually is a new commit for the plugin?
Is your feature request related to a problem? Please describe.
I'm unsure whether it can be stated as a bug or feature request, or just docs clarification. packer.nvim also have implicit lazy loading when there's a setup function in a plugin spec, BUT, the plugin still loads despite having a setup function.
The trade-off there seems to lean towards more at setting up the plugin than complying with an strict implicit lazy loading rule. I think that's why there opt verb may be more on point than lazy, because a plugin spec with a setup function is still lazily loaded, it's installed on opt/, BUT, still loaded, BECAUSE opt = true has not been set, it's lazy, but not opt. You have to set opt = true for something to actually not be loaded.
Describe the solution you'd like
๐ค
Describe alternatives you've considered
I had a bunch of plugins with setup functions which I expected to load, the setup was just for that, setting up, not implicitly causing opt = true. Migrating to lazy.nvim it seems I have to set lazy = false to achieve the same bare "setting up" behavior when setting up init functions. I hope it's all fine doing that.
Is your feature request related to a problem? Please describe.
Hello!
I am thinking about migrating my Neovim configuration to this package manager but my Neovim configuration uses Fennel with hotpot.nvim. That means that I have some plugins that I must have installed before the plugins module can be compiled.
...which would always install hotpot.nvim for me and then would use the compiled conf.plugins module.
Describe the solution you'd like
It would be ideal to be able to specify some plugins inside the init.lua file and a module containing plugins to load.
Describe alternatives you've considered
I have considered bootstrapping hotpot.nvim but I am not sure of what the best practice for this would be.
If I am able to do that I could load lazy.nvim inside fnl/conf/init.fnl.
Additional context
I have already setup a Lua demo configuration and I am loving this plugin. ๐
Failed to load **plugins**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:105: cannot open /Users/farzadmf/.config/nvim/l
ua/plugins/init.lua: No such file or directory
Expected Behavior
Since I'm using those individual files to separate my plugins, it doesn't make much sense to me to have the init.lua file in there
Screenshots
If applicable, add screenshots to help explain your problem.
Log :Lazy log shows:
Lazy log
Failed to load **plugins**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:105: cannot open /Users/farzadmf/.config/nvim/l
ua/plugins/init.lua: No such file or directory
but for some reason, even though the tag doesn't change (v.3.1.0 as of writing this post), every check says that there are updates to this plugin.
reproduced with minimal configurations:
minimal.lua
local function join_paths(...)
local result = table.concat({ ... }, '/')
return result
end
local temp_dir = vim.loop.os_getenv 'TEMP' or '/tmp'
local package_root = join_paths(temp_dir, 'nvim', 'site', 'lazy')
local lazypath = join_paths(temp_dir, 'nvim', 'site') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'--single-branch',
'https://github.com/folke/lazy.nvim.git',
lazypath,
}
end
vim.opt.runtimepath:prepend(lazypath)
This plugin (mine) https://github.com/ilAYAli/scMRU.nvim works with Packer et al. but not with Lazy.
I followed this guide when I wrote it.
The mentioned sqlite3 lua rocks module is fairly old so I should probably just replace it. Regardless, other plugins might use a similar pattern, so the issue might be of interest.
Which version of Neovim are you using?
NVIM v0.8.0-1210-gd367ed9b2
Steps to reproduce the behavior:
Lazy fails during installation with a minimal config file.
:checkhealth and Lazy log does not contain any errors, but the following is printed to :messages
Failed to source `/Users/username/.local/share/nvim/lazy/scMRU.nvim/plugin/mru.vim`
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:185: Vim(lua):E5108: Error executing lua ...er/.local/share/nvim/lazy/scMRU.nvim/lua/mru/display.lua:1: module 'ljsqlite3' not found:
^Ino field package.preload['ljsqlite3']not found in lazy cache
^Ino file './ljsqlite3.lua'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/ljsqlite3.lua'
^Ino file '/usr/local/share/lua/5.1/ljsqlite3.lua'
^Ino file '/usr/local/share/lua/5.1/ljsqlite3/init.lua'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/ljsqlite3.lua'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/ljsqlite3/init.lua'
^Ino file '/Users/username/.local/share/nvim/lazy/scMRU.nvim/plugin/../lua/mru/deps/lua-ljsqlite3/init.lua'
^Ino file './ljsqlite3.so'
^Ino file '/usr/local/lib/lua/5.1/ljsqlite3.so'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/ljsqlite3.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'ljsqlite3 not found in lazy plugins
stack traceback:
^I[C]: in function 'require'
^I...er/.local/share/nvim/lazy/scMRU.nvim/lua/mru/display.lua:1: in main chunk
^I[C]: in function 'require'
^I...etter/.local/share/nvim/lazy/scMRU.nvim/lua/mru/init.lua:1: in main chunk
^I[C]: in function 'require'
^I[string ":lua"]:1: in main chunk
^I[C]: in function 'cmd'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:185: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:184>
^I[C]: in function 'xpcall'
^I.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:77: in function 'try'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:184: in function 'source'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:178: in function 'source_runtime'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:149: in function 'packadd'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:133: in function 'load'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:64: in function 'startup'
^I...etter/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:58: in function 'setup'
^I/Users/username/sync/config/nvim/init.lua:19: in main chunk
Describe the bug
I'm not sure if this should be opened in https://github.com/rhysd/committia.vim or in here.
After moving 99% of my plugins only this one is left which doesn't seem to be working, whether it's lazy-loaded or not.
Which version of Neovim are you using?
Neovim nightly latest
just some things (I just write those here because I think they don't exist yet and are quite nice)
you can consider which (if any) are worth implementing
Describe the bug
The Color Scheme needs to be loaded twice to fully take effect. This issue only occurred after switching to lazy, it did not occur with packer. It occurs with all color schemes I have tested.
When the color scheme is set once, the blue dots (listchars) and the color column to the right are off. Setting the color scheme two times fixes this. (sorry for the sound, forgot to turn off audio during recording)
Describe the bug
Even with minimal setup and basically empty nvim folder (minus init.lua), I get an error thrown on fresh start after the lazy window open for a second or so.
Which version of Neovim are you using?
NVIM v0.9.0-dev-528+g3283f4ebd
Build type: Release
LuaJIT 2.1.0-beta3
To Reproduce
Steps to reproduce the behavior:
cd ~/.config/ && mv nvim nvim.bak to remove any rtp stuff and have clean nvim folder
rm -rf ~/.config/local/share/nvim/lazy to remove any previous lazy stuff
rm -rf ~/.config/local/state/nvim/lazy to remove any previous lazy stuff
mkdir ~/.config/nvim && cd ~/.config/nvim to create fresh nvim folder
lazy.nvim window opens on restart, and then this error occurs:
Error detected while processing VimEnter Autocommands for "*":
Error executing lua callback: ...g/local/share/nvim/lazy/lazy.nvim/lua/lazy/view/init.lua:84: Invalid window id: 1001
stack traceback:
[C]: in function 'nvim_set_current_win'
...g/local/share/nvim/lazy/lazy.nvim/lua/lazy/view/init.lua:84: in function <...g/local/share/nvim/lazy/lazy.nvim/lua/lazy/view/init.lua:83>
Expected Behavior
On startup lazy.nvim is installed and plugins are installed.
Screenshots
Nothing really to see, just an empty buffer with that error in the messages area.
:checkhealth lazy output:
lazy: require("lazy.health").check()
lazy.nvim ~
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found
Describe the bug
The four plugins load and work as expected, but in the Lazy window, they get some error message where I cannot figure out what the issue is
any lua file in ~/.config/nvim/lua/plugins/*.lua will be automatically merged in the main plugin spec
But currently only the ~/.config/nvim/lua/plugins/init.lua file gets sourced and plugins installed from it. For example my fuzzy finder is neither loaded nor installed: :lua require('fzf-lua').files():
E5108: Error executing lua [string ":lua"]:1: module 'fzf-lua' not found:
no field package.preload['fzf-lua']
no file '/nix/store/w08dyn0iamcixgc6cgv9ma8sq165vlvq-luajit-2.1.0-2022-10-04-env/share/lua/5.1/fzf-lua.lua'
no file '/nix/store/w08dyn0iamcixgc6cgv9ma8sq165vlvq-luajit-2.1.0-2022-10-04-env/share/lua/5.1/fzf-lua/init.lua'
no file '/nix/store/w08dyn0iamcixgc6cgv9ma8sq165vlvq-luajit-2.1.0-2022-10-04-env/lib/lua/5.1/fzf-lua.so'fzf-lua not found in lazy plugin
s
stack traceback:
[C]: in function 'require'
[string ":lua"]:1: in main chunk
Is your feature request related to a problem? Please describe.
The window for lazy.nvim is smaller than it has to be. I have a small screen and bigger font size (bad eyes...), and lazy.nvim only takes up a smaller portion of the available space, making everything very crowded.
Describe the solution you'd like
Either a bigger window by default, or a ui-config to enlarge the window
Describe alternatives you've considered
Zooming out, but that decreases font size.
Great care has been taken to make the startup code (lazy.core) as efficient as possible. During startup, all lua files used before VimEnter or BufReadPre are byte-compiled and cached, similar to what impatient.nvim does.
I am just wondering if impatient.nvim is still doing anything if I'm using lazy.nvim? If I remove impatient.nvim I still get performance 2-3 times better than with packer.nvim + impatient.nvim.