rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.35k stars 117 forks source link

Feature request: improve lazy-loading mechanisms #385

Open NTBBloodbath opened 1 month ago

NTBBloodbath commented 1 month ago

As the author and user of many plugins, I have been mired in problems before with lazy-loading and having to carry all that logic on my part as a user.

As a plugin author, I think this should not be something the user needs to do. This is why rest.nvim has some lazy-loading on the :Rest command and autocommands side, however, I would like to further extend this mechanism so that absolutely nothing of the plugin loads outside of http files, as that would be the most logical and optimal way.


But how to make this change possible? A mechanism could be used by using an ftplugin file and changing the way setup works, making it also take a global variable (vim.g.rest_nvim_config or _G._rest_nvim_config?) to separate configuration from initialization of the plugin and achieve complete lazy-loading.

Any suggestion is welcome in this issue, I'll have some free time next week to work on the plugin and bug fixes too.