1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
-- Set header
dashboard.section.header.val = art.misc.hydra
-- Set menu
dashboard.section.buttons.val = {
dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files<CR>"),
dashboard.button( "r", " > Find recent file", ":Telescope oldfiles<CR>"),
dashboard.button( "s", " > Load session", ""),
dashboard.button( "q", " > Quit", ":qa<CR>"),
}
-- Send config to alpha
alpha.setup(dashboard.opts)
-- Set options just for the dashboard.
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "alpha",
callback = function()
vim.opt_local.foldenable = false -- disable folding
end,
})
-- Refresh dashboard when window resized.
vim.api.nvim_create_autocmd("VimResized", {
-- pattern = "alpha",
callback = function()
print("redrawn")
vim.cmd.AlphaRedraw()
end
})
|