feat: buffer cmp for search, and path for command mode (#3147)

This commit is contained in:
opalmay 2022-10-07 08:17:18 +03:00 committed by GitHub
parent dcdfbf1727
commit 9509cadf40
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -260,8 +260,8 @@ M.config = function()
{ name = "tmux" },
},
mapping = cmp.mapping.preset.insert {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-k>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<C-j>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
["<Down>"] = cmp.mapping(cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select }, { "i" }),
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select }, { "i" }),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
@ -325,7 +325,21 @@ M.config = function()
end
function M.setup()
require("cmp").setup(lvim.builtin.cmp)
local cmp = require "cmp"
cmp.setup(lvim.builtin.cmp)
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "path" },
},
})
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
end
return M