brainfucksec / neovim-lua

Neovim KISS configuration with Lua
GNU General Public License v3.0
826 stars 116 forks source link

fix a misleading mistake in the settings #19

Closed mrded closed 2 years ago

mrded commented 2 years ago

The comment and the code suggest it's disabled. 0 is disabled.

brainfucksec commented 2 years ago

@mrded, thanks for the correction, actually the default plugins were all loaded at startup :( See: https://vi.stackexchange.com/questions/10939/how-to-see-if-a-plugin-is-active

I execute the merge.

brainfucksec commented 2 years ago

Edit: I believe that although counterintuitive the instruction with the value 1 is correct.

See: https://github.com/NvChad/NvChad/blob/main/lua/core/options.lua

mrded commented 2 years ago

It must be a mistake. I've just randomly checked plugins from the list, and I can confirm that 0 disables them.

Try following:

:echo match(&runtimepath, '2html_plugin')
:echo match(&runtimepath, 'matchit')
:echo match(&runtimepath, 'gzip')
brainfucksec commented 2 years ago

Hi @mrded, it's strange with that command I get -1 in any case, even the :scriptnames command returns me the plugin paths anyway. But I think the function is correct, for example, if I comment the strings netrw, netrwPlugin, the netrw plugin is active (you can start it with the :Explore command), by reinserting the strings, netrw (the :Explore command) is no longer available.

Maybe I'm wrong, but I think the logic of the function is to "trick" neovim by assigning the value 1 to the global variable loaded_ as if the plugins had been loaded, perhaps it is the only method to disable them? This requires further investigation however.