goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

Open Alpha on every new tab with autocmd #134

Closed lockieluke closed 2 years ago

lockieluke commented 2 years ago

Discussed in https://github.com/goolord/alpha-nvim/discussions/133

Originally posted by **lockieluke** August 4, 2022 I tried making an auto command function to open alpha on each new tab I open but it didn't work, I am pretty sure that the function is actually triggered when a tab is opened but it just doesn't work ```lua local alpha_start_group = vim.api.nvim_create_augroup("AlphaStart", { clear = true }) vim.api.nvim_create_autocmd("TabNew", { callback = function() alpha.start() end, group = alpha_start_group, buffer = 0 }) ```
goolord commented 2 years ago

you want "TabNewEntered", not "TabNew" and no buffer=0. if you make that change this works for me @lockieluke

local alpha_start_group = vim.api.nvim_create_augroup("AlphaStart", { clear = true })
vim.api.nvim_create_autocmd("TabNewEntered", {
    callback = function()
        alpha.start()
    end,
    group = alpha_start_group,
})
lockieluke commented 2 years ago

Thanks!