Use Lua files to configure Neovim

Using plugins with Neovim tend to have a considerable amount of lua.

You can add your lua config to vimscript in Neovim using:

lua <<EOF
require('module')
EOF
lua require('module')

Use a file to setup your config

Lua looks up files based on a list of paths. Neovim is setup to use ~/.config/nvim/ as your lookup directory. This allows us to use the pattern of lookup that uses ~/.config/nvim/lua/my_config.lua to match for require('my_config').

This means you can have the following setup.

You can then set your config in ~/.config/nvim/lua/my_config.lua

print('this is my config')

And in ~/.config/nvim/init.vim require your lua file.

lua require('my_config')

Now you have access to all the lua options, including vim, in lua.