This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
init.lua
157 lines (147 loc) · 5.42 KB
/
init.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
local dashboard = {}
dashboard.settings = {
entries = {
{
icon = " ",
desc = "Recently Opened Files ",
shortcut = "SPC f r",
action = "Telescope oldfiles",
},
{
icon = " ",
desc = "Jump to Bookmark ",
shortcut = "SPC s m",
action = "Telescope marks",
},
{
icon = " ",
desc = "Open Configuration ",
shortcut = "SPC D c",
action = "e " .. require("doom.core.config").source,
},
{
icon = " ",
desc = "Open Modules ",
shortcut = "SPC D m",
action = "e " .. require("doom.core.modules").source,
},
{
icon = " ",
desc = "Open Documentation ",
shortcut = "SPC D d",
action = "lua require('doom.core.functions').open_docs()",
},
},
header = {
" ",
"================= =============== =============== ======== ========",
"\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //",
"||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||",
"|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||",
"||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||",
"|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||",
"||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||",
"|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||",
"||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||",
"|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||",
"|| `' || || `' || || `' || || | \\ / | ||",
"|| .===' `===. .==='.`===. .===' /==. | \\/ | ||",
"|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||",
"|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||",
"|| .==' _-' `-__\\._-' `-_./__-' `' |. /| | ||",
"||.==' _-' `' | /==.||",
"==' _-' N E O V I M \\/ `==",
"\\ _-' `-_ /",
" `'' ``' ",
},
footer = { "", "Doom Nvim loaded" },
colors = {
header = "#586268",
center = "#51afef",
shortcut = "#a9a1e1",
footer = "#586268",
},
}
dashboard.packages = {
["dashboard-nvim"] = {
"glepnir/dashboard-nvim",
cmd = "Dashboard",
lazy = true,
},
}
dashboard.configs = {}
dashboard.configs["dashboard-nvim"] = function()
local utils = require("doom.utils")
local db = require("dashboard")
local is_module_enabled = utils.is_module_enabled
if is_module_enabled("features", "auto_session") then
vim.g.dashboard_session_directory = doom.features.auto_session.settings.dir
end
if is_module_enabled("features", "telescope") then
vim.g.dashboard_default_executive = "telescope"
end
if is_module_enabled("features", "auto_session") then
doom.features.dashboard.settings.entries.a = {
icon = " ",
desc = "Load Last Session ",
shortcut = "SPC q r",
action = "lua require('persistence').load({ last = true })",
}
end
db.custom_center = doom.features.dashboard.settings.entries
if type(doom.features.dashboard.settings.footer) ~= "function" then
db.custom_footer = doom.features.dashboard.settings.footer
end
if type(doom.features.dashboard.settings.header) ~= "function" then
db.custom_header = doom.features.dashboard.settings.header
end
db.hide_tabline = false
db.hide_statusline = false
-- Header color
vim.cmd("hi! dashboardHeader guifg=" .. doom.features.dashboard.settings.colors.header)
vim.cmd("hi! dashboardCenter guifg=" .. doom.features.dashboard.settings.colors.center)
vim.cmd("hi! DashboardCenterIcon guifg=" .. doom.features.dashboard.settings.colors.center)
vim.cmd("hi! dashboardShortcut guifg=" .. doom.features.dashboard.settings.colors.shortcut)
vim.cmd("hi! dashboardFooter guifg=" .. doom.features.dashboard.settings.colors.footer)
end
dashboard.binds = {
"<leader>",
name = "+prefix",
{
{
"o",
name = "+open/close",
{
{ "D", "<cmd>Dashboard<CR>", name = "Dashboard" },
},
},
},
}
dashboard.autocmds = {
{
"FileType",
"dashboard",
function()
require("doom.services.keymaps").applyKeymaps({ "q", "<cmd>q<CR>", buffer = true })
end,
},
{
"VimEnter",
"*",
function()
local utils = require("doom.utils")
local is_module_enabled = utils.is_module_enabled
-- Here we check for
-- 1. Number of files passed to Neovim as arguments during its launch
-- 2. Bytes count from the start of the buffer to the end (it should be non-existent, -1)
-- 3. Existence of the buffer
if vim.fn.argc() == 0 and vim.fn.line2byte("$") == -1 and vim.fn.bufexists(0) == 0 then
if is_module_enabled("features", "dashboard") then
vim.cmd("Dashboard")
end
end
end,
once = true,
},
}
return dashboard