diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2024-10-18 21:50:58 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2024-10-18 21:50:58 -0500 |
commit | 43558b3a614de4a9174824b1cb4de8bc1ad147a9 (patch) | |
tree | b00315d7783f457d675410e36c2a0cf68b022bcc /lua/tjk/plugins/cmp.lua | |
download | nvim-43558b3a614de4a9174824b1cb4de8bc1ad147a9.tar.xz nvim-43558b3a614de4a9174824b1cb4de8bc1ad147a9.zip |
initial commit
Diffstat (limited to 'lua/tjk/plugins/cmp.lua')
-rw-r--r-- | lua/tjk/plugins/cmp.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lua/tjk/plugins/cmp.lua b/lua/tjk/plugins/cmp.lua new file mode 100644 index 0000000..1a3cf2f --- /dev/null +++ b/lua/tjk/plugins/cmp.lua @@ -0,0 +1,26 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-path", + "hrsh7th/cmp-buffer", + "ray-x/cmp-treesitter", + }, + config = function() + local cmp = require("cmp") + cmp.setup { + sources = { + { name = "path" }, + { name = "buffer" }, + { name = "treesitter" }, + }, + mapping = cmp.mapping.preset.insert { + --['<C-b>'] = cmp.mapping.scroll_docs(-4), + --['<C-f>'] = cmp.mapping.scroll_docs(4), + --['<C-Space>'] = cmp.mapping.complete(), + --['<C-e>'] = cmp.mapping.abort(), + --['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ['<Tab>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }, + } + end +} |