add cmp-ai
This commit is contained in:
parent
3745d69205
commit
59d23bdca8
3 changed files with 40 additions and 0 deletions
19
config/programs/vim/config/lua/config/cmp-ai.lua
Normal file
19
config/programs/vim/config/lua/config/cmp-ai.lua
Normal 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
|
||||||
|
},
|
||||||
|
})
|
|
@ -23,6 +23,16 @@ cmp.setup {
|
||||||
["<Esc>"] = cmp.mapping.close(),
|
["<Esc>"] = cmp.mapping.close(),
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = 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 = {
|
sources = {
|
||||||
{ name = "nvim_lsp" }, -- For nvim-lsp
|
{ name = "nvim_lsp" }, -- For nvim-lsp
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
asyncrun-vim
|
asyncrun-vim
|
||||||
bufferline-nvim
|
bufferline-nvim
|
||||||
catppuccin-nvim
|
catppuccin-nvim
|
||||||
|
cmp-ai
|
||||||
cmp-buffer
|
cmp-buffer
|
||||||
cmp-emoji
|
cmp-emoji
|
||||||
cmp-nvim-lsp
|
cmp-nvim-lsp
|
||||||
|
@ -103,11 +104,20 @@
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
"hrsh7th/cmp-omni",
|
"hrsh7th/cmp-omni",
|
||||||
"hrsh7th/cmp-emoji",
|
"hrsh7th/cmp-emoji",
|
||||||
|
"tzachar/cmp-ai"
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("config.nvim-cmp")
|
require("config.nvim-cmp")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"tzachar/cmp-ai",
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = {'nvim-lua/plenary.nvim'},
|
||||||
|
config = function()
|
||||||
|
require("config.cmp-ai")
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufRead", "BufNewFile" },
|
event = { "BufRead", "BufNewFile" },
|
||||||
|
@ -435,6 +445,7 @@
|
||||||
"stevearc",
|
"stevearc",
|
||||||
"tpope",
|
"tpope",
|
||||||
"tyru",
|
"tyru",
|
||||||
|
"tzachar",
|
||||||
"wellle",
|
"wellle",
|
||||||
"Yggdroot",
|
"Yggdroot",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue