chore(nvim): optimize lazy loading

This commit is contained in:
js0ny 2025-03-05 01:31:11 +00:00
parent 6f3665bf47
commit f12260deb2
8 changed files with 79 additions and 13 deletions

View file

@ -1,7 +1,7 @@
return {
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
event = "BufRead",
-- lazy = false,
version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes.
opts = {
-- add any opts here

View file

@ -9,6 +9,7 @@ elseif vim.env.TERM_PROGRAM == "alacritty" then
else
return {
"3rd/image.nvim",
opts = {}
opts = {},
event = "BufReadPre",
}
end

View file

@ -8,7 +8,8 @@ end
return {
"hrsh7th/nvim-cmp",
lazy = false,
-- lazy = false,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
@ -58,15 +59,32 @@ return {
})
-- 配置 cmdline 模式
cmp.setup.cmdline(":", {
-- cmp.setup.cmdline(":", {
-- mapping = cmp.mapping.preset.cmdline(),
-- sources = {
-- { name = "cmdline" },
-- },
-- })
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "cmdline" },
-- path completion is slow under WSL
-- Since WSL loads Windows Environment Variables
{ name = "buffer" },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
-- 配置 LSP
for _, server in ipairs(servers) do
local config = vim.tbl_deep_extend("force", default_server_config, servers_config[server] or {})

View file

@ -1,8 +1,35 @@
return {
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = false,
-- lazy = false,
ft = "markdown",
cmd = {
"ObsidianNewFromTemplate",
"ObsidianToggleCheckbox",
"ObsidianQuickSwitch",
"ObsidianExtractNote",
"ObsidianFollowLink",
"ObsidianBacklinks",
"ObsidianWorkspace",
"ObsidianYesterday",
"ObsidianPasteImg",
"ObsidianTomorrow",
"ObsidianTemplate",
"ObsidianDailies",
"ObsidianLinkNew",
"ObsidianRename",
"ObsidianSearch",
"ObsidianCheck",
"ObsidianLinks",
"ObsidianToday",
"ObsidianDebug",
"ObsidianOpen",
"ObsidianTags",
"ObsidianLink",
"ObsidianNew",
"ObsidianTOC",
},
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
@ -32,5 +59,11 @@ return {
enable = false,
},
-- see below for full list of options 👇
attachments = {
img_folder = "_Global/Assets",
img_name_func = function()
return string.format("%s-", os.time())
end,
},
},
}