Skip to content

Commit 5a19851

Browse files
committed
perf: defer startup work — lazy-load markview, fix eager key specs, move diagnostics to VeryLazy
1 parent 3b807d1 commit 5a19851

5 files changed

Lines changed: 32 additions & 42 deletions

File tree

lazy-lock.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
66
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
77
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
8-
"lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" },
98
"markview.nvim": { "branch": "main", "commit": "9e852c299351fc2110e763edc7fc899358ee112e" },
109
"mini": { "branch": "main", "commit": "dbb073bd2ed4a7bb35daafc7989567f0ff1426ee" },
1110
"snacks": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },

lua/lazy_spec.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ require("lazy").setup("plugins", {
2020
"parser",
2121
"gzip",
2222
"netrwPlugin",
23+
"netrw",
24+
"netrwSettings",
25+
"netrwFileHandlers",
2326
"health",
2427
"man",
2528
"matchit",
29+
"matchparen",
2630
"rplugin",
2731
"tarPlugin",
2832
"tohtml",

lua/opts.lua

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,28 @@ opts.final = function()
5656
-- Statusline
5757
local statusline_ascii = ""
5858
opt.statusline = "%#Normal#" .. statusline_ascii .. "%="
59+
60+
-- Diagnostics
61+
vim.diagnostic.config {
62+
virtual_text = {
63+
prefix = "",
64+
suffix = "",
65+
format = function(diagnostic)
66+
return " " .. diagnostic.message .. " "
67+
end,
68+
},
69+
underline = {
70+
severity = { min = vim.diagnostic.severity.WARN },
71+
},
72+
signs = {
73+
text = {
74+
[vim.diagnostic.severity.HINT] = "",
75+
[vim.diagnostic.severity.ERROR] = "",
76+
[vim.diagnostic.severity.INFO] = "",
77+
[vim.diagnostic.severity.WARN] = "󰚌",
78+
},
79+
},
80+
}
5981
end
6082

6183

@@ -76,25 +98,4 @@ vim.api.nvim_create_autocmd("User", {
7698
end,
7799
})
78100

79-
vim.diagnostic.config {
80-
virtual_text = {
81-
prefix = "",
82-
suffix = "",
83-
format = function(diagnostic)
84-
return "" .. diagnostic.message .. " "
85-
end,
86-
},
87-
underline = {
88-
severity = { min = vim.diagnostic.severity.WARN },
89-
},
90-
signs = {
91-
text = {
92-
[vim.diagnostic.severity.HINT] = "",
93-
[vim.diagnostic.severity.ERROR] = "",
94-
[vim.diagnostic.severity.INFO] = "",
95-
[vim.diagnostic.severity.WARN] = "󰚌",
96-
},
97-
},
98-
}
99-
100101
return opts

lua/plugins/misc.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local conf_path = vim.fn.stdpath "config" --[[@as string]]
22
return {
33
{
44
"OXY2DEV/markview.nvim",
5-
lazy = false,
5+
ft = "markdown",
66
opts = {
77
preview = {
88
icon_provider = "mini", -- "mini" or "devicons"
@@ -16,9 +16,7 @@ return {
1616
name = "dropbar",
1717
event = { "BufReadPost", "BufNewFile" },
1818
keys = {
19-
require("mappings").map({ "n" }, "<leader>p", function()
20-
require("dropbar.api").pick(vim.v.count ~= 0 and vim.v.count or nil)
21-
end, "Toggle dropbar menu"),
19+
{ "<leader>p", function() require("dropbar.api").pick(vim.v.count ~= 0 and vim.v.count or nil) end, desc = "Toggle dropbar menu" },
2220
},
2321
opts = {},
2422
},

lua/plugins/snacks.lua

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,10 @@ return {
22
"folke/snacks.nvim",
33
name = "snacks",
44
keys = {
5-
require("mappings").map({ "n" }, "<leader>o", function()
6-
require("snacks").scratch()
7-
end, "Toggle scratch pad"),
8-
9-
require("mappings").map({ "n" }, "<leader>E", function()
10-
require("snacks").picker.explorer()
11-
end, "Toggle snacks explorer"),
12-
13-
require("mappings").map({ "n" }, "<leader>F", function()
14-
require("snacks").picker.pick("files")
15-
end, "Toggle find files snacks"),
16-
17-
require("mappings").map({ "n", "t" }, "<A-t>", function()
18-
require("snacks").terminal()
19-
end, "Toggle terminal buffer")
20-
5+
{ "<leader>o", function() require("snacks").scratch() end, desc = "Toggle scratch pad" },
6+
{ "<leader>E", function() require("snacks").picker.explorer() end, desc = "Toggle snacks explorer" },
7+
{ "<leader>F", function() require("snacks").picker.pick("files") end, desc = "Toggle find files snacks" },
8+
{ "<A-t>", function() require("snacks").terminal() end, mode = { "n", "t" }, desc = "Toggle terminal buffer" },
219
},
2210
event = { "BufReadPost" },
2311
opts = {

0 commit comments

Comments
 (0)