diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-06-04 18:42:09 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-06-04 18:43:00 +0800 |
commit | 494c9f27f2483440d022a11c4a81ddd7bea33cb5 (patch) | |
tree | 5c6cf80ae2ee849344be14832fb561bae1fc07be /store/config/nvim/lua/setup/plugins/cmp.lua | |
parent | c3cdc6e002eec05be3bcaa4fb14e5dff06e975da (diff) | |
download | crupest-494c9f27f2483440d022a11c4a81ddd7bea33cb5.tar.gz crupest-494c9f27f2483440d022a11c4a81ddd7bea33cb5.tar.bz2 crupest-494c9f27f2483440d022a11c4a81ddd7bea33cb5.zip |
chore(config): move dir.
Diffstat (limited to 'store/config/nvim/lua/setup/plugins/cmp.lua')
-rw-r--r-- | store/config/nvim/lua/setup/plugins/cmp.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/store/config/nvim/lua/setup/plugins/cmp.lua b/store/config/nvim/lua/setup/plugins/cmp.lua new file mode 100644 index 0000000..be9f8ea --- /dev/null +++ b/store/config/nvim/lua/setup/plugins/cmp.lua @@ -0,0 +1,30 @@ +local function setup() + local cmp = require("cmp") + + cmp.setup { + snippet = { + expand = function(args) + vim.snippet.expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-j>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), + ['<C-k>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), + ['<C-e>'] = cmp.mapping.abort(), + ['<C-y>'] = cmp.mapping.confirm({ select = true }), + ['<CR>'] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'path' }, + }, { + { name = 'buffer' }, + }) + } +end + +return { + setup = setup +} |