summaryrefslogtreecommitdiff
path: root/lua/tjk/plugins/cmp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/tjk/plugins/cmp.lua')
-rw-r--r--lua/tjk/plugins/cmp.lua26
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
+}