Neovim Lua modules
Neovim will load the requires files from its runtime paths; see
runtimepath
from the Neovim help systembuilt on top of the already existing Lua modules system
while searching for the runtime paths, Neovim will search for certain folders
plugin/
will load all of the Lua files that are placed in that subdirectorylua/
also contains Lua files but does not automatically load until some other module will callrequire
to that moduleinit.lua
is basically theindex.html
for HTML files,default.nix
for Nix language, ormod.rs
for Rust language
in module names that are
require
'd,.
is treated as a separator and representing as a directory in the file tree; e.g., when runningrequire("custom.plugins")
,custom.plugins
should have a module at$RUNTIMEPATH/lua/custom/plugins/init.lua
at some point, Neovim can make use of more Lua modules with Luarocks