summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/plugins/alpha.lua
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-07-09 00:21:42 -0400
committertriethyl <triethylammonium@pm.me>2025-07-09 00:21:42 -0400
commited82f622069233e7b9f817e687865f19fb88b8bb (patch)
tree7fd27fb471cf02ca72235b4d890634d53815573b /pkgs/custom-neovim/config/lua/plugins/alpha.lua
parent405c50fe980449290fa11c0c3b813954eacf4c4f (diff)
working on dashboard
Former-commit-id: 5f31e111f7ffa0ef63d503c8641d0789cf18b868
Diffstat (limited to 'pkgs/custom-neovim/config/lua/plugins/alpha.lua')
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/alpha.lua26
1 files changed, 19 insertions, 7 deletions
diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua
index ef39612..5ccdc3f 100644
--- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua
@@ -6,16 +6,28 @@ 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( "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>"),
+ dashboard.button( "s", " > Load session", ""),
+ dashboard.button( "q", " > Quit", ":qa<CR>"),
}
-- Send config to alpha
alpha.setup(dashboard.opts)
--- Disable folding on alpha buffer
-vim.cmd([[
- autocmd FileType alpha setlocal nofoldenable
-]])
+-- 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
+})