From 29d9b7960d7d999f26397f1dda81b6c2430e9006 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Tue, 13 Jun 2023 17:24:37 -0700 Subject: [PATCH] Disable lua_ls formatting in favor of stylua --- neovim/lua/plugins/lsp.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index 79a8f46..fd538e9 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -309,7 +309,21 @@ function M.config_lsp() -- Setup each server with default config vim.tbl_map(function(server) - lsp_config[server].setup(default_setup) + if server == "lua_ls" then + -- Disable formatting with lua_ls because I use luacheck + local config = vim.tbl_extend("force", default_setup, { + settings = { + Lua = { + format = { + enable = false, + }, + }, + }, + }) + lsp_config[server].setup(config) + else + lsp_config[server].setup(default_setup) + end end, needs_setup) end)