lua/josean/plugins/alpha-nvim.lua (2021B)
1 return {
2 "goolord/alpha-nvim",
3 event = "VimEnter",
4 dependencies = { "nvim-tree/nvim-web-devicons" },
5 config = function()
6 local alpha = require("alpha")
7 local dashboard = require("alpha.themes.dashboard")
8
9 -- Set header
10 dashboard.section.header.val = {
11 " ",
12 " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
13 " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
14 " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
15 " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
16 " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
17 " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
18 " ",
19 }
20
21 -- Set menu
22 dashboard.section.buttons.val = {
23 dashboard.button("e", " > New File", "<cmd>ene<CR>"),
24 dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
25 dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
26 dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
27 dashboard.button("SPC wr", " > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
28 dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
29 }
30
31 -- Send config to alpha
32 alpha.setup(dashboard.opts)
33
34 -- Disable folding on alpha buffer
35 vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
36 end,
37 }