local M = {} function M.setup() local cmp = require("cmp") cmp.setup({ mapping = { [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}), [''] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), [''] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), [''] = cmp.config.disable, [''] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}), [''] = cmp.mapping.confirm({select = true}) }, sources = cmp.config.sources({}, {{name = 'buffer'}}) }) -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}}) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', {sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})}) end return M