Clarification about LazyFile
event
#1583
-
Hi @folke, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
It's a shortcut for Previously when you opened a file directly like The new change renders the file as fast as possible and right after that loads any file-based plugins. I mainly added this as an internal event for LazyVim specs, but you're of course free to also use this in your own config. |
Beta Was this translation helpful? Give feedback.
It's a shortcut for
event = { "BufReadPost", "BufWritePost", "BufNewFile" }
, but defers (and re-triggers) the event to make sure the ui isn't blocked for initial rendering.Previously when you opened a file directly like
nvim foo.lua
, then Neovim triggersBufReadPost
events beforeVimEnter
.This is annoying, since in our case lsp-config, treesitter and others would block showing the actual file.
The new change renders the file as fast as possible and right after that loads any file-based plugins.
As a consequence, the startuptime of
nvim foo.lua
will now be similar to just doingnvim
.I mainly added this as an internal event for LazyVim specs, but you're of course free to also use this in…