diff --git a/7.-Contoh-Custom-Plugins.md b/7.-Contoh-Custom-Plugins.md index 31c4f35..3f2abdd 100644 --- a/7.-Contoh-Custom-Plugins.md +++ b/7.-Contoh-Custom-Plugins.md @@ -1393,8 +1393,16 @@ return { event = "BufWinEnter", config = function() local cmp = require("cmp") + local mapping = { + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + } -- Use buffer source for `/`. cmp.setup.cmdline("/", { + mapping = mapping, sources = { { name = "buffer" }, }, @@ -1402,6 +1410,7 @@ return { -- Use cmdline & path source for ':'. cmp.setup.cmdline(":", { + mapping = mapping, sources = cmp.config.sources({ { name = "path" }, }, {