Skip to content

Commit 13f1105

Browse files
committed
upgrade dashboard config
1 parent ed0604f commit 13f1105

File tree

1 file changed

+68
-20
lines changed

1 file changed

+68
-20
lines changed

lua/plugin-config/dashboard.lua

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,64 @@
1-
vim.g.dashboard_default_executive = "telescope"
2-
vim.g.dashboard_custom_footer = { "https://github.com/nshen/learn-neovim-lua" }
1+
local status, db = pcall(require, "dashboard")
2+
if not status then
3+
vim.notify("没有找到 dashboard")
4+
return
5+
end
36

4-
vim.g.dashboard_custom_section = {
5-
a = { description = { " Projects " }, command = "Telescope projects" },
6-
b = { description = { " Recently files " }, command = "Telescope oldfiles" },
7-
c = { description = { " Edit keybindings " }, command = "edit ~/.config/nvim/lua/keybindings.lua" },
8-
d = {
9-
description = { " Edit Projects " },
10-
command = "edit ~/.local/share/nvim/project_nvim/project_history",
11-
},
12-
-- e = { description = { " Edit .bashrc " }, command = "edit ~/.bashrc" },
13-
-- f = { description = { " Change colorscheme " }, command = "ChangeColorScheme" },
14-
-- g = { description = { " Edit init.lua " }, command = "edit ~/.config/nvim/init.lua" },
15-
-- h = { description = {' Find file '}, command = 'Telescope find_files'},
16-
-- i = { description = {' Find text '}, command = 'Telescope live_grep'},
7+
db.custom_footer = {
8+
"",
9+
"",
10+
"https://github.com/nshen/learn-neovim-lua",
1711
}
1812

19-
vim.g.dashboard_custom_header = {
13+
db.custom_center = {
14+
{
15+
icon = "",
16+
desc = "Projects ",
17+
action = "Telescope projects",
18+
},
19+
{
20+
icon = "",
21+
desc = "Recently files ",
22+
action = "Telescope oldfiles",
23+
},
24+
{
25+
icon = "",
26+
desc = "Edit keybindings ",
27+
action = "edit ~/.config/nvim/lua/keybindings.lua",
28+
},
29+
{
30+
icon = "",
31+
desc = "Edit Projects ",
32+
action = "edit ~/.local/share/nvim/project_nvim/project_history",
33+
},
34+
-- {
35+
-- icon = " ",
36+
-- desc = "Edit .bashrc ",
37+
-- action = "edit ~/.bashrc",
38+
-- },
39+
-- {
40+
-- icon = " ",
41+
-- desc = "Change colorscheme ",
42+
-- action = "ChangeColorScheme",
43+
-- },
44+
-- {
45+
-- icon = " ",
46+
-- desc = "Edit init.lua ",
47+
-- action = "edit ~/.config/nvim/init.lua",
48+
-- },
49+
-- {
50+
-- icon = " ",
51+
-- desc = "Find file ",
52+
-- action = "Telescope find_files",
53+
-- },
54+
-- {
55+
-- icon = " ",
56+
-- desc = "Find text ",
57+
-- action = "Telescopecope live_grep",
58+
-- },
59+
}
60+
db.custom_header = {
61+
[[]],
2062
[[███╗ ██╗███████╗██╗ ██╗███████╗███╗ ██╗]],
2163
[[████╗ ██║██╔════╝██║ ██║██╔════╝████╗ ██║]],
2264
[[██╔██╗ ██║███████╗███████║█████╗ ██╔██╗ ██║]],
@@ -25,7 +67,8 @@ vim.g.dashboard_custom_header = {
2567
[[╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝]],
2668
}
2769

28-
vim.g.dashboard_custom_header = {
70+
db.custom_header = {
71+
[[]],
2972
[[ ▀████▀▄▄ ▄█ ]],
3073
[[ █▀ ▀▀▄▄▄▄▄ ▄▄▀▀█ ]],
3174
[[ ▄ █ ▀▀▀▀▄ ▄▀ ]],
@@ -37,7 +80,8 @@ vim.g.dashboard_custom_header = {
3780
[[ █ █ █ ▄▄ ▄▀ ]],
3881
}
3982

40-
vim.g.dashboard_custom_header = {
83+
db.custom_header = {
84+
[[]],
4185
[[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗]],
4286
[[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║]],
4387
[[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║]],
@@ -48,7 +92,8 @@ vim.g.dashboard_custom_header = {
4892
[[ [ version : 1.0.0 ] ]],
4993
}
5094

51-
vim.g.dashboard_custom_header = {
95+
db.custom_header = {
96+
[[]],
5297
[[ ██╗██╗ ██╗███████╗ ██╗██╗███╗ ██╗ ██████╗███╗ ██╗]],
5398
[[ ██║██║ ██║██╔════╝ ██║██║████╗ ██║ ██╔════╝████╗ ██║]],
5499
[[ ██║██║ ██║█████╗ ██║██║██╔██╗ ██║ ██║ ██╔██╗ ██║]],
@@ -59,7 +104,8 @@ vim.g.dashboard_custom_header = {
59104
[[ [ version : 1.0.0 ] ]],
60105
}
61106

62-
vim.g.dashboard_custom_header = {
107+
db.custom_header = {
108+
[[]],
63109
[[ ██╗██╗ ██╗███████╗ ██╗██╗███╗ ██╗]],
64110
[[ ██║██║ ██║██╔════╝ ██║██║████╗ ██║]],
65111
[[ ██║██║ ██║█████╗ ██║██║██╔██╗ ██║]],
@@ -68,4 +114,6 @@ vim.g.dashboard_custom_header = {
68114
[[ ╚════╝ ╚═════╝ ╚══════╝ ╚════╝ ╚═╝╚═╝ ╚═══╝]],
69115
[[ ]],
70116
[[ [ version : 1.0.0 ] ]],
117+
[[]],
118+
[[]],
71119
}

0 commit comments

Comments
 (0)