Skip to content

Commit

Permalink
perf(cmp-cmdline): lazy load (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
meijieru authored Aug 27, 2023
1 parent d7c7868 commit f073e0f
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions lua/astrocommunity/completion/cmp-cmdline/init.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
local cmp = require "cmp"

return {
"hrsh7th/cmp-cmdline",
lazy = false,
opts = {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{
name = "cmdline",
option = {
ignore_cmds = { "Man", "!" },
opts = function()
local cmp_mapping = require "cmp.config.mapping"
local cmp_sources = require "cmp.config.sources"

return {
mapping = cmp_mapping.preset.cmdline(),
sources = cmp_sources({
{ name = "path" },
}, {
{
name = "cmdline",
option = {
ignore_cmds = { "Man", "!" },
},
},
},
}, {
{ name = "buffer" },
}),
},
}, {
{ name = "buffer" },
}),
}
end,
config = function(_, opts) require("cmp").setup.cmdline(":", opts) end,
dependencies = {
"nvim-cmp",
},
event = { "CmdlineEnter" },
}

0 comments on commit f073e0f

Please sign in to comment.