Lua: question about server runtime path

The example config assembles the runtime path the following way:

local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")

require'lspconfig'.sumneko_lua.setup {
  settings = {
    Lua = {
      runtime = {
        -- Setup your lua path
        path = runtime_path,

This produces a list of a dozen or so directories. Are these necessary for the proper functioning of the server, or just a way to ensure the server runtime is found on different platforms?

Differently put, can I simply point path to the directory below, or will that leave LSP lacking something?

$ cd /usr/lib/lua-language-server/



This config adds Lua files that ship with Neovim. You can omit them, but then if you are editing Neovim scripts, the Lua language server won’t recognize the modules because they won’t be in the package path.

@moondust is table.insert adding a path to local modules in .config/nvim/lua/?

I believe so, because that directory should be in package.path. But you should check it for yourself in your own setup, to make sure.