diff --git a/after/ftplugin/lua.vim b/after/ftplugin/lua.vim index cb1abf5..1c60d66 100644 --- a/after/ftplugin/lua.vim +++ b/after/ftplugin/lua.vim @@ -4,4 +4,4 @@ set formatoptions-=r nnoremap :luafile % -nnoremap f !stylua % +nnoremap f silent !stylua % diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 87d88fc..f2c8492 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -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" }, "f", vim.lsp.buf.format, { desc = "format code" }) end