Configuring formatter for Lua

This commit is contained in:
Eduardo Cueto-Mendoza 2023-08-07 12:59:29 +01:00
parent cc8d398753
commit d058cadf33
2 changed files with 53 additions and 20 deletions

View File

@ -41,7 +41,40 @@ require('lspconfig').clangd.setup({})
require('lspconfig').julials.setup({}) require('lspconfig').julials.setup({})
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) require('lspconfig').lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
neededFileStatus = {
["codestyle-check"] = "Any",
},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
format = {
enable = true,
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
indent_style = "space",
indent_size = "4",
}
},
},
},
})
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt" local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
local words = {} local words = {}