Execution order conflict in mixed Vimscript and Lua configurations
0 reputation · 17 Jan 2023, 03:41 UTC
Configuration Load Sequence
Neovim allows the coexistence of legacy Vimscript and modern Lua configurations, typically transitioning from init.vim to init.lua. While vim.fn enables Lua to call Vimscript functions, the execution order between these two languages can become ambiguous when complex plugin dependencies are involved.
Component: LuaJIT Interpreter and vim.api
When utilizing the vim.api module to manipulate buffers and options, the timing of these calls relative to legacy Vimscript autocmd events is critical. There is uncertainty regarding how Neovim prioritizes the loading of Lua-based settings when they are triggered by Vimscript-defined events, potentially leading to settings being overwritten or ignored during the startup sequence.
- How does Neovim resolve priority when a Vimscript autocmd and a Lua function attempt to modify the same global option simultaneously?
- Is there a documented mechanism to ensure a specific Lua block executes strictly after all legacy Vimscript plugins have initialized?