darkrc/vim/plugin/bufhiddendelete.lua

18 lines
364 B
Lua
Raw Normal View History

2024-06-20 12:46:10 +00:00
vim.api.nvim_create_user_command("BHD", function()
vim.bo.bufhidden = "delete"
end, {})
2024-06-20 12:53:06 +00:00
vim.api.nvim_create_user_command("BHK", function()
vim.bo.bufhidden = nil
end, {})
2024-06-20 12:46:10 +00:00
vim.g.ephemeral_buffers = false
vim.api.nvim_create_autocmd("BufAdd", {
callback = function(args)
if vim.g.ephemeral_buffers then
vim.bo[args.buf].bufhidden = "delete"
end
end
})