From 1b295597f4eb0567b2a80c8d04cd622d2fba38e7 Mon Sep 17 00:00:00 2001 From: Simon Lasbrugnas Date: Mon, 19 Jan 2026 16:37:55 +0100 Subject: [PATCH] fix(fugitive): disable lsp in diff buffers --- lua/config/autocmds.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 8f208f4..629d6df 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -72,3 +72,16 @@ vim.api.nvim_create_autocmd("BufWritePost", { end end, }) + +-- Disable LSP in fugitive buffers +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + local bufnr = args.buf + if vim.api.nvim_buf_get_name(bufnr):match("^fugitive://") then + if client then + vim.lsp.stop_client(client.id) + end + end + end, +})