In my init.lua
I call:
require('plugins')
require('theme')
This works when editing in the ~/.config/nvim
directory, where init.lua
, plugins.lua
and theme.lua
are located.
But when I run vim outside of this directory, I get the following error:
E5113: Error while calling lua chunk: /home/miki/.config/nvim/init.lua:5: module 'plugins' n
ot found:
no field package.preload['plugins']
no file './plugins.lua'
no file '/usr/share/luajit-2.1.0-beta3/plugins.lua'
no file '/usr/local/share/lua/5.1/plugins.lua'
no file '/usr/local/share/lua/5.1/plugins/init.lua'
no file '/usr/share/lua/5.1/plugins.lua'
no file '/usr/share/lua/5.1/plugins/init.lua'
no file './plugins.so'
no file '/usr/local/lib/lua/5.1/plugins.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/plugins.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
How do I add ~/.config/nvim
to the places Lua looks for modules?
I also tried to put these modules into ~/.config/nvim/lua
folder, but then they were not found even in the init.lua
.