Open Alpha Dashboard after closing all buffers
This commit is contained in:
parent
c0daeb5f24
commit
feb3b5afa3
17
init.lua
17
init.lua
@ -403,6 +403,23 @@ local config = {
|
|||||||
-- ["~/%.config/foo/.*"] = "fooscript",
|
-- ["~/%.config/foo/.*"] = "fooscript",
|
||||||
-- },
|
-- },
|
||||||
-- }
|
-- }
|
||||||
|
local function alpha_on_bye(cmd)
|
||||||
|
local bufs = vim.fn.getbufinfo { buflisted = true }
|
||||||
|
vim.cmd(cmd)
|
||||||
|
if require("core.utils").is_available "alpha-nvim" and not bufs[2] then
|
||||||
|
require("alpha").start(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.keymap.del("n", "<leader>c")
|
||||||
|
if require("core.utils").is_available "bufdelete.nvim" then
|
||||||
|
vim.keymap.set("n", "<leader>c", function()
|
||||||
|
alpha_on_bye "Bdelete!"
|
||||||
|
end, { desc = "Close buffer" })
|
||||||
|
else
|
||||||
|
vim.keymap.set("n", "<leader>c", function()
|
||||||
|
alpha_on_bye "bdelete!"
|
||||||
|
end, { desc = "Close buffer" })
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user