add cmp-ai

This commit is contained in:
Charlotte 🦝 Delenk 2024-07-16 07:26:57 +02:00
parent 3745d69205
commit 59d23bdca8
3 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,19 @@
local cmp_ai = require('cmp_ai.config')
cmp_ai:setup({
max_lines = 100,
provider = 'Ollama',
provider_options = {
model = 'codellama:13b-code-q6_K',
},
notify = true,
notify_callback = function(msg)
vim.notify(msg)
end,
run_on_every_keystroke = true,
ignored_file_types = {
-- default is not to ignore
-- uncomment to ignore in lua:
-- lua = true
},
})

View file

@ -23,6 +23,16 @@ cmp.setup {
["<Esc>"] = cmp.mapping.close(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
['<C-x>'] = cmp.mapping(
cmp.mapping.complete({
config = {
sources = cmp.config.sources({
{ name = 'cmp_ai' },
}),
},
}),
{ 'i' }
),
},
sources = {
{ name = "nvim_lsp" }, -- For nvim-lsp

View file

@ -18,6 +18,7 @@
asyncrun-vim
bufferline-nvim
catppuccin-nvim
cmp-ai
cmp-buffer
cmp-emoji
cmp-nvim-lsp
@ -103,11 +104,20 @@
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-omni",
"hrsh7th/cmp-emoji",
"tzachar/cmp-ai"
},
config = function()
require("config.nvim-cmp")
end,
},
{
"tzachar/cmp-ai",
event = "VeryLazy",
dependencies = {'nvim-lua/plenary.nvim'},
config = function()
require("config.cmp-ai")
end,
},
{
"neovim/nvim-lspconfig",
event = { "BufRead", "BufNewFile" },
@ -435,6 +445,7 @@
"stevearc",
"tpope",
"tyru",
"tzachar",
"wellle",
"Yggdroot",
},