2023-05-06 19:17:16 +02:00
|
|
|
local signtoggle = vim.api.nvim_create_augroup("signtoggle", { clear = true })
|
|
|
|
|
|
|
|
-- Only show sign column for the currently focused buffer
|
|
|
|
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "WinEnter" }, {
|
|
|
|
pattern = "*",
|
|
|
|
group = signtoggle,
|
2024-07-15 21:40:59 +02:00
|
|
|
callback = function()
|
|
|
|
vim.opt.signcolumn = "yes"
|
|
|
|
end,
|
2023-05-06 19:17:16 +02:00
|
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "WinLeave" }, {
|
|
|
|
pattern = "*",
|
|
|
|
group = signtoggle,
|
2024-07-15 21:40:59 +02:00
|
|
|
callback = function()
|
|
|
|
vim.opt.signcolumn = "no"
|
|
|
|
end,
|
2023-05-06 19:17:16 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Never show the sign column in a terminal buffer
|
|
|
|
vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
|
|
|
pattern = "*",
|
|
|
|
group = signtoggle,
|
2024-07-15 21:40:59 +02:00
|
|
|
callback = function()
|
|
|
|
vim.opt.signcolumn = "no"
|
|
|
|
end,
|
2023-05-06 19:17:16 +02:00
|
|
|
})
|