mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
feat(cmp): add configs for cmp.setup.cmdline (#3180)
This commit is contained in:
parent
e6f50af1de
commit
5aec1756ce
1 changed files with 25 additions and 12 deletions
|
@ -334,6 +334,23 @@ M.config = function()
|
|||
fallback() -- if not exited early, always fallback
|
||||
end),
|
||||
},
|
||||
cmdline = {
|
||||
enable = true,
|
||||
options = {
|
||||
{
|
||||
type = ":",
|
||||
sources = {
|
||||
{ name = "path" },
|
||||
},
|
||||
},
|
||||
{
|
||||
type = { "/", "?" },
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -341,18 +358,14 @@ function M.setup()
|
|||
local cmp = require "cmp"
|
||||
cmp.setup(lvim.builtin.cmp)
|
||||
|
||||
cmp.setup.cmdline(":", {
|
||||
if lvim.builtin.cmp.cmdline.enable then
|
||||
for _, option in ipairs(lvim.builtin.cmp.cmdline.options) do
|
||||
cmp.setup.cmdline(option.type, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
sources = option.sources,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Reference in a new issue