aboutsummaryrefslogtreecommitdiffstats
path: root/lua/plugins/completition.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins/completition.lua')
-rw-r--r--lua/plugins/completition.lua82
1 files changed, 68 insertions, 14 deletions
diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua
index 91a7b89..071c16c 100644
--- a/lua/plugins/completition.lua
+++ b/lua/plugins/completition.lua
@@ -5,16 +5,63 @@ return {
"rafamadriz/friendly-snippets",
{ "L3MON4D3/LuaSnip", version = "v1.*" },
"windwp/nvim-autopairs",
- {
- "zbirenbaum/copilot.lua",
- cmd = { "Copilot" },
- event = { "VeryLazy" },
- opts = { suggestion = { enabled = false }, panel = { enabled = false } },
- },
- -- Add blink.cmp copilot source
- "giuxtaposition/blink-cmp-copilot",
+ -- {
+ -- "zbirenbaum/copilot.lua",
+ -- cmd = { "Copilot" },
+ -- event = { "VeryLazy" },
+ -- opts = { suggestion = { enabled = false }, panel = { enabled = false } },
+ -- },
+ -- -- Add blink.cmp copilot source
+ -- {
+ -- "giuxtaposition/blink-cmp-copilot",
+ -- },
-- Add blink.cmp latex source for LaTeX/VimTeX support
"erooke/blink-cmp-latex",
+ -- Add minuet-ai for AI completions with llama-server
+ {
+ "milanglacier/minuet-ai.nvim",
+ config = function()
+ require('minuet').setup {
+ provider = 'openai_fim_compatible',
+ n_completions = 1, -- recommend for local model for resource saving
+ -- I recommend beginning with a small context window size and incrementally
+ -- expanding it, depending on your local computing power. A context window
+ -- of 512, serves as an good starting point to estimate your computing
+ -- power. Once you have a reliable estimate of your local computing power,
+ -- you should adjust the context window to a larger value.
+ context_window = 512,
+ provider_options = {
+ openai_fim_compatible = {
+ -- For Windows users, TERM may not be present in environment variables.
+ -- Consider using APPDATA instead.
+ api_key = 'TERM',
+ name = 'Qwen',
+ end_point = 'http://localhost:8012/v1/completions',
+ -- The model is set by the llama-cpp server and cannot be altered
+ -- post-launch.
+ model = 'PLACEHOLDER',
+ optional = {
+ max_tokens = 56,
+ top_p = 0.9,
+ },
+ -- Llama.cpp does not support the `suffix` option in FIM completion.
+ -- Therefore, we must disable it and manually populate the special
+ -- tokens required for FIM completion.
+ template = {
+ prompt = function(context_before_cursor, context_after_cursor, _)
+ return '<|fim_prefix|>'
+ .. context_before_cursor
+ .. '<|fim_suffix|>'
+ .. context_after_cursor
+ .. '<|fim_middle|>'
+ end,
+ suffix = false,
+ },
+ },
+ },
+ }
+ end,
+ },
},
-- use a release tag to download pre-built binaries
@@ -60,7 +107,7 @@ return {
border = "rounded",
draw = {
columns = {
- { "label", "label_description", gap = 1 },
+ { "label", "label_description", gap = 1 },
{ "kind_icon", "kind" },
},
},
@@ -70,19 +117,26 @@ return {
-- Default list of enabled providers
sources = {
- default = { "lsp", "path", "snippets", "buffer", "copilot" },
+ default = { "lsp", "path", "snippets", "buffer", "minuet" },
+ -- default = { "lsp", "path", "snippets", "buffer", "copilot", "minuet" },
per_filetype = {
tex = { "lsp", "path", "snippets", "buffer", "latex" },
bib = { "lsp", "path", "snippets", "buffer", "latex" },
codecompanion = { "codecompanion" },
},
providers = {
- copilot = {
- name = "copilot",
- module = "blink-cmp-copilot",
- score_offset = 100,
+ minuet = {
+ name = "minuet",
+ module = "minuet.blink",
+ score_offset = 101,
async = true,
},
+ -- copilot = {
+ -- name = "copilot",
+ -- module = "blink-cmp-copilot",
+ -- score_offset = 100,
+ -- async = true,
+ -- },
latex = {
name = "latex",
module = "blink-cmp-latex",