mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
chore(nvim): optimize lazy loading
This commit is contained in:
parent
6f3665bf47
commit
f12260deb2
8 changed files with 79 additions and 13 deletions
|
|
@ -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 {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue