when is extras/lang/xxx.lua executed? #3137
-
I am trying to understand how extras/lang/xxx.lua works. Take rust.lua for example. When does rust.lua gets run? if I open an empty buffer (not a Rust source file) is rust.lua run at all? I understand rustaceanvim is only run if filetype is rust.
what about this section in rust.lua, is this section run even if I open an empty buffer?
Please help, Thanks! I am really confused how LazyVim works although I use it daily. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Every LazyExtra is usually a combination of different plugins specs. For example the nvim-treesitter plugin spec will run even if you open another file, because it will need to enable the necessary parser for the corresponding language. And even in an empty buffer it will still run because it's loaded on |
Beta Was this translation helpful? Give feedback.
Every LazyExtra is usually a combination of different plugins specs. For example the nvim-treesitter plugin spec will run even if you open another file, because it will need to enable the necessary parser for the corresponding language. And even in an empty buffer it will still run because it's loaded on
VeryLazy
, it will just not use any parser in an empty buffer until the filetype of that opened buffer is determined (which is usually done when you assign a name to the empty buffer).