Till now I have been trying to configure my neovim using one huge init.lua file. This is what I guess with my limited knowledge of vim and was trying to do to in neovim as well.
But recently I came across some old youtube videos by Leeren which went describe the various folder structure like “after”,“ftdetect” etc which one can use to configure vim.
Wanted to know if there is any optimum protocol for doing this folder and file structure for doing this. Does it improve the performance of NEOVIM if we do this instead of one init.lua file.
I am new to this and trying learn the best practice
I suggest reading the help for ‘runtimepath’. (Neo)vim looks for configuration files in specific directories, which determine the order in which those files are loaded. You can place both .vim and .lua files in those directories, and .vim files will be loaded before .lua files.
For example, suppose you want to set some options for a plugin called foo; if you place your configuration in ~/.config/nvim/after/plugin/foo.lua or in ~/.config/nvim/after/plugin/foo/bar.lua, neovim will load it automatically after foo has been loaded (and it won’t load that configuration if plugins have not been loaded).
On the other hand, most options specific to a given file type, say tex, go in ~/.nvim/ftplugin/tex.lua.