Skip to content

Conversation

carsakiller
Copy link
Collaborator

Updates Neovim configuration instructions to follow their new config method.

Closes #52

@carsakiller carsakiller added the wiki/improvement Larger improvement to existing documentation label Sep 14, 2025
Copy link

@DrKJeff16 DrKJeff16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LuaRocks section applies aswell.

@@ -55,21 +55,32 @@ Below are some examples for getting set up in Neovim in different environments.
Below is a minimal example showing how to set the runtime version of the language server.

```Lua
require'lspconfig'.lua_ls.setup{
vim.lsp.config['luals'] = {
Copy link

@DrKJeff16 DrKJeff16 Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From experience I've found calling vim.lsp.config() to be a safer bet:

vim.lsp.config('lua_ls', ...)

-- Sets the "workspace" to the directory where any of these files is found.
-- Files that share a root directory will reuse the LSP server connection.
-- Nested lists indicate equal priority, see vim.lsp.Config.
root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' },
Copy link

@DrKJeff16 DrKJeff16 Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root_markers doesn't generally go with a mixed list (I am to blame because I copy-pasted the suggestion in #52 without enough care):

    root_markers = {
        ".luarc.json",
        ".luarc.jsonc",
        ".luacheckrc",
        ".stylua.toml",
        "stylua.toml",
        "selene.toml",
        "selene.yml",
        ".git",
    },

Comment on lines +68 to 72
version = 'LuaJIT',
}
}
}
}
Copy link

@DrKJeff16 DrKJeff16 Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To activate the server, you must call vim.lsp.enable() after configuring:

-- ...

vim.lsp.enable('lua_ls')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wiki/improvement Larger improvement to existing documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with wiki page "configuration"
2 participants