diff --git a/lua/keymap.lua b/lua/keymap.lua index 8669a4f..a9103c9 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -142,5 +142,11 @@ return { "", "Telescope current_buffer_fuzzy_find", { noremap = true, desc = "Find" }, + }, + { + { "n" }, + "", + "lua vim.lsp.buf.format()", + { noremap = true, desc = "Format active buffer" } } } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index b7db171..ff6d8fa 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -38,8 +38,6 @@ return { function(server_name) -- default handler (optional) require("lspconfig")[server_name].setup({ on_attach = function(client, bufnr) - -- setup lsp-format - require("lsp-format").on_attach(client, bufnr) end }) end, @@ -58,9 +56,6 @@ return { require("lspconfig").gdscript.setup({}) end, }, - { - 'lukas-reineke/lsp-format.nvim', - }, { "jinzhongjia/LspUI.nvim", branch = "main", diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 4afcdbb..cdfb7e4 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -63,6 +63,19 @@ return { vim.cmd("Mason") end, 100) end + }, + { + function() + return ' 󰛖 ' + end, + padding = 0, + on_click = function() + vim.defer_fn( + function() + vim.lsp.buf.format() + end, 100 + ) + end } }, lualine_c = {