I’ve been trying out Love2D by recreating old retro games, I like how simple Love is, and I get to use neovim as my editor of choice. While browsing the Lua LS documentation, I noticed this on the “Add-ons” page.

Addons can be used to add additional content for the Lua Language Server by doing the following:

- Providing definitions for a framework/library/API.

This had bothered me for a while, since using Love’s API does not provide any sort of competition.

First, pick a directory to store all your add-ons. Mine will be ~/.local/share/LuaAddons.

mkdir ~/.local/share/LuaAddons
cd ~/.local/share/LuaAddons

Here we will grab a copy of the Love2D add-on.

git clone https://github.com/LuaCATS/love2d.git

Open your neovim configuration and edit Lua LS’s set-up snippet.

lspconfig.lua_ls.setup {
    settings = {
        Lua = {
            workspace = {
                -- Path to your Addons directory
                userThirdParty = {os.getenv("HOME") .. ".local/share/LuaAddons"},
                checkThirdParty = "Apply"
            }
        }
    }
}

This should be everything you need to get a nice competition menu when using love.

Editor screenshot with hover documentation showing Love2D's API

2026 Update: I have now switched to LazyVim, here is an updated snippet to extend your server settings.

--- lua/plugins/love.lua
return {
  "neovim/nvim-lspconfig",
  opts = {
    servers = {
      lua_ls = {
        settings = {
          Lua = {
            workspace = {
              library = { os.getenv("HOME") .. "/.local/share/LuaAddons" },
              checkThirdParty = false,
            },
          },
        },
      },
    },
  },
}

You can check the official documentation for reference.

Original Post: https://dev.to/je12emy/how-to-configure-neovims-lua-ls-for-love2d-1an6