mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
feat: buffer cmp for search, and path for command mode (#3147)
This commit is contained in:
parent
dcdfbf1727
commit
9509cadf40
1 changed files with 17 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue