aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/pi/completition/init.lua11
-rw-r--r--lua/pi/lsp/default.lua2
-rw-r--r--lua/plugins/cmp-ai.lua59
3 files changed, 70 insertions, 2 deletions
diff --git a/lua/pi/completition/init.lua b/lua/pi/completition/init.lua
index ec128a0..5b9fd18 100644
--- a/lua/pi/completition/init.lua
+++ b/lua/pi/completition/init.lua
@@ -55,13 +55,14 @@ cmp.setup {
["<c-space>"] = cmp.mapping.complete(),
},
sources = {
- { name = "dictionary", keyword_length = 2},
+ -- { name = "dictionary", keyword_length = 2},
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "luasnip" },
{ name = "copilot" },
{name = "codeium"},
+ { name = 'cmp_ai' },
{ name = 'html-css',
option = {
max_count = {}, -- not ready yet
@@ -109,6 +110,7 @@ cmp.setup {
local KIND_ICONS = {
Tailwind = '󰹞󰹞󰹞󰹞󰹞󰹞󰹞󰹞',
Copilot = "",
+ Ollama = "",
Text = "󰉿",
Method = "󰆧",
Function = "󰊕",
@@ -135,6 +137,9 @@ cmp.setup {
Operator = "󰆕",
Codeium = "",
TypeParameter = "󰜅",
+ OpenAI = "",
+ TinyLlama = "󱝊",
+ LlamaCPP = ""
}
if vim_item.kind == 'Color' and entry.completion_item.documentation then
@@ -179,6 +184,10 @@ cmp.setup {
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#3426C3" })
vim.api.nvim_set_hl(0, "CmpItemKindCodeium", { fg = "#2ACDBA" })
+vim.api.nvim_set_hl(0, "CmpItemKindOllama", { fg = "#FDFEFF" })
+vim.api.nvim_set_hl(0, "CmpItemKindOpenAI", { fg = "#080808" })
+vim.api.nvim_set_hl(0, "CmpItemKindTinyLlama", { fg = "#DF468C"})
+vim.api.nvim_set_hl(0, "CmpItemKindLlamaCPP", { fg = "#FF8235"})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
diff --git a/lua/pi/lsp/default.lua b/lua/pi/lsp/default.lua
index 8a47cbf..ff5c97e 100644
--- a/lua/pi/lsp/default.lua
+++ b/lua/pi/lsp/default.lua
@@ -9,7 +9,7 @@ return {
html = { enable = true },
jsonls = { enable = true },
lua_ls = { enable = true, neodev = true },
- nil_ls = { enable = true },
+ -- nil_ls = { enable = true },
phpactor = {enable = true },
rust_analyzer = { enable = true },
svelte = { enable = true },
diff --git a/lua/plugins/cmp-ai.lua b/lua/plugins/cmp-ai.lua
new file mode 100644
index 0000000..5431187
--- /dev/null
+++ b/lua/plugins/cmp-ai.lua
@@ -0,0 +1,59 @@
+return {
+ "ElvisClaros/cmp-ai",
+ dependencies = "nvim-lua/plenary.nvim",
+ config = function()
+ local cmp_ai = require "cmp_ai.config"
+ cmp_ai:setup {
+ max_lines = 10,
+ provider = "LlamaCPP",
+ provider_options = {
+ model = "null",
+ },
+ notify = false,
+ 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
+ },
+ }
+
+ -- cmp_ai:setup {
+ -- max_lines = 10,
+ -- provider = "Ollama",
+ -- provider_options = {
+ -- model = "tinyllama:1.1b",
+ -- },
+ -- notify = false,
+ -- 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
+ -- },
+ -- }
+ -- cmp_ai:setup {
+ -- max_lines = 10,
+ -- provider = "OpenAI",
+ -- provider_options = {
+ -- model = "gpt-4",
+ -- },
+ -- 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
+ -- },
+ -- }
+ end,
+}