-
Notifications
You must be signed in to change notification settings - Fork 0
/
08_dashboard.lua
39 lines (30 loc) · 1.12 KB
/
08_dashboard.lua
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
34
35
36
37
38
39
local alpha_start_dashboard = {
title = 'Hello world!',
buttons = {
{"e", " > New File", "<cmd>ene<CR>"},
{"n", " > Toggle file explorer", "<cmd>Neotree<CR>"},
{"f", " > Find File", "<cmd>Telescope find_files<CR>"},
{"F", " > Find Word", "<cmd>Telescope live_grep<CR>"},
{"m", " > Keymaps", "<cmd>Telescope keymaps<CR>"},
{"g", " > Git status", "<cmd>Git<CR>"},
{"u", " > Update plugins", "<cmd>PlugUpdate<CR>"},
{"H", " > Edit .vimrc", "<cmd>e ~/.vimrc<CR>"},
{"c", " > Change colorscheme", "<cmd>Telescope themes<CR>"},
}
}
local alpha = require("alpha")
local startify = require("alpha.themes.startify")
local title = alpha_start_dashboard.title or 'Hello world'
startify.section.header.val = { title }
startify.opts.layout[1].val = 2
startify.opts.opts.margin = 3
-- disable MRU
startify.section.mru.val = { { type = "padding", val = 0 } }
local buttons = {}
for _, data in pairs(alpha_start_dashboard.buttons or {}) do
local btn = startify.button(unpack(data))
table.insert(buttons, btn)
end
startify.section.top_buttons.val = buttons
-- Send config to alpha
alpha.setup(startify.config)