nix-config/modules/home/vim/plugin/signtoggle.lua
Bruno BELANYI 65a8f7c481 home: create 'modules/home' folder
Consolidating all modules under the same path, to clear out the
top-level directory.
2023-11-11 18:12:05 +00:00

21 lines
640 B
Lua

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,
command = "setlocal signcolumn=yes",
})
vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "WinLeave" }, {
pattern = "*",
group = signtoggle,
command = "setlocal signcolumn=yes",
})
-- Never show the sign column in a terminal buffer
vim.api.nvim_create_autocmd({ "TermOpen" }, {
pattern = "*",
group = signtoggle,
command = "setlocal signcolumn=no",
})