How do I diagnose slow Neovim startup and identify which plugins are taking the longest to load?
Answer
:Lazy profile
Explanation
When Neovim starts slowly, finding the culprit plugin is tedious without tooling. lazy.nvim ships a built-in profiler that records the load time of every plugin and presents them in an interactive, sortable UI. Running :Lazy profile immediately shows you exactly where startup time is being spent, so you can tune your lazy-loading configuration with real data instead of guessing.
How it works
:Lazyopens the lazy.nvim plugin manager UI:Lazy profileopens the profile view directly, showing all plugins with their load times in milliseconds- Results are sorted by load time by default — the slowest plugins appear first
- You can see whether each plugin was loaded eagerly (on startup) or lazily (on demand)
- Press
<CR>on a plugin entry to view its configuration and loading triggers
To enable profiling across sessions, set profiling = { loader = true, require = true } in your lazy.nvim config.
Example
After a fresh Neovim open, run :Lazy profile. The output might show:
Plugin Time
nvim-treesitter 45ms (eager)
nvim-lspconfig 12ms (event: BufReadPost)
telescope.nvim 8ms (cmd: Telescope)
This tells you nvim-treesitter is loading on every startup and may be worth converting to a lazy event trigger.
Tips
- Add
lazy = trueto plugins that don't need to load at startup; trigger them onevent = 'BufReadPost'orcmd = ...instead :Lazy healthruns a health check across all installed plugins:Lazy syncupdates all plugins to their latest versions- Use
--profilein your Neovim startup wrapper script to capture profiling data externally withnvim --startuptime /tmp/startup.log