summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/plugins/alpha.lua
diff options
context:
space:
mode:
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
+})