diff --git a/.config/nvim/lua/plugins/lsp-config.lua b/.config/nvim/lua/plugins/lsp-config.lua index e7708cf..a1a0cb2 100644 --- a/.config/nvim/lua/plugins/lsp-config.lua +++ b/.config/nvim/lua/plugins/lsp-config.lua @@ -6,7 +6,7 @@ capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) vim.keymap.set("n", "K", "lua vim.lsp.buf.hover()") vim.keymap.set("i", "", "lua vim.lsp.buf.signature_help()") vim.keymap.set("n", "1gd", "lua vim.lsp.buf.type_definition()") -vim.keymap.set("n", "gf", "lua vim.lsp.buf.formatting()") +vim.keymap.set("n", "gf", "lua vim.lsp.buf.format()") vim.keymap.set("n", "rn", "lua vim.lsp.buf.rename()") vim.keymap.set("n", "[d", "lua vim.lsp.diagnostic.goto_prev()") vim.keymap.set("n", "]d", "lua vim.lsp.diagnostic.goto_next()") @@ -14,6 +14,8 @@ vim.keymap.set("n", "gwa", "lua vim.lsp.buf.add_workspace_folder()") vim.keymap.set("n", "gwr", "lua vim.lsp.buf.add_workspace_folder()") vim.keymap.set("n", "gwl", "lua vim.lsp.buf.add_workspace_folder()") +vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format({sync = true})]]) + local border = { { "🭽", "FloatBorder" }, { "▔", "FloatBorder" },