mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
silently format lua file using stylua
We need to disable the mapping set for LSP, otherwise the mapping set in lua.vim will be overridden.
This commit is contained in:
@@ -50,7 +50,7 @@ local custom_attach = function(client, bufnr)
|
||||
end, { desc = "list workspace folder" })
|
||||
|
||||
-- Set some key bindings conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
if client.server_capabilities.documentFormattingProvider and client.name ~= "lua_ls" then
|
||||
map({ "n", "x" }, "<space>f", vim.lsp.buf.format, { desc = "format code" })
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user