doc: add minuet-ai.nvim, a code completion plugin for neovim. (#248)

This commit is contained in:
milanglacier 2025-02-17 02:34:12 -05:00 committed by GitHub
parent e0d7b1f4ed
commit ab1ea1799d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 364 additions and 0 deletions

View File

@ -427,6 +427,11 @@ English/[简体中文](https://github.com/deepseek-ai/awesome-deepseek-integrati
<td> <a href="docs/codecompanion.nvim/README.md"> codecompanion.nvim </a> </td> <td> <a href="docs/codecompanion.nvim/README.md"> codecompanion.nvim </a> </td>
<td> AI-powered coding, seamlessly in Neovim. </td> <td> AI-powered coding, seamlessly in Neovim. </td>
</tr> </tr>
<tr>
<td> <img src="https://github.com/user-attachments/assets/d66dfc62-8e69-4b00-8549-d0158e48e2e0" alt="Icon" width="64" height="auto" /> </td>
<td> <a href="docs/minuet-ai.nvim/README.md"> minuet-ai.nvim </a> </td>
<td> Minuet offers code completion as-you-type from popular LLMs including Deepseek, OpenAI, Gemini, Claude, Ollama, Codestral, and more. </td>
</tr>
</table> </table>
### JetBrains Extensions ### JetBrains Extensions

View File

@ -306,6 +306,11 @@
<td> <a href="docs/llm.nvim/README.md"> llm.nvim </a> </td> <td> <a href="docs/llm.nvim/README.md"> llm.nvim </a> </td>
<td> 免费的大语言模型插件让你在Neovim中与大模型交互支持任意一款大模型比如DeepseekGPTGLMkimi或者本地运行的大模型(比如ollama) </td> <td> 免费的大语言模型插件让你在Neovim中与大模型交互支持任意一款大模型比如DeepseekGPTGLMkimi或者本地运行的大模型(比如ollama) </td>
</tr> </tr>
<tr>
<td> <img src="https://github.com/user-attachments/assets/d66dfc62-8e69-4b00-8549-d0158e48e2e0" alt="Icon" width="64" height="auto" /> </td>
<td> <a href="docs/minuet-ai.nvim/README_cn.md"> minuet-ai.nvim </a> </td>
<td> Minuet 提供实时代码补全功能,支持多个主流大语言模型,包括 Deepseek、OpenAI、Gemini、Claude、Ollama、Codestral 等。 </td>
</tr>
<tr> <tr>
<td> <img src="https://github.com/user-attachments/assets/d66dfc62-8e69-4b00-8549-d0158e48e2e0" alt="Icon" width="64" height="auto" /> </td> <td> <img src="https://github.com/user-attachments/assets/d66dfc62-8e69-4b00-8549-d0158e48e2e0" alt="Icon" width="64" height="auto" /> </td>
<td> <a href="docs/codecompanion.nvim/README.md"> codecompanion.nvim </a> </td> <td> <a href="docs/codecompanion.nvim/README.md"> codecompanion.nvim </a> </td>

View File

@ -0,0 +1,182 @@
# Minuet AI
Minuet AI: Dance with Intelligence in Your Code 💃.
`Minuet-ai` brings the grace and harmony of a minuet to your coding process.
Just as dancers move during a minuet.
# Features
- AI-powered code completion with dual modes:
- Specialized prompts and various enhancements for chat-based LLMs on code completion tasks.
- Fill-in-the-middle (FIM) completion for compatible models (DeepSeek,
Codestral, Qwen, and others).
- Support for multiple AI providers (OpenAI, Claude, Gemini, Codestral, Ollama, and
OpenAI-compatible services).
- Customizable configuration options.
- Streaming support to enable completion delivery even with slower LLMs.
- Support `nvim-cmp`, `blink-cmp`, `virtual text` frontend.
# Requirements
- Neovim 0.10+.
- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
- optional: [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
- optional: [blink.cmp](https://github.com/Saghen/blink.cmp)
- An API key for at least one of the supported AI providers
# Installation
**Lazy.nvim**:
```lua
specs = {
{
'milanglacier/minuet-ai.nvim',
config = function()
require('minuet').setup {
-- Your configuration options here
}
end,
},
{ 'nvim-lua/plenary.nvim' },
-- optional, if you are using virtual-text frontend, nvim-cmp is not
-- required.
{ 'hrsh7th/nvim-cmp' },
-- optional, if you are using virtual-text frontend, blink is not required.
{ 'Saghen/blink.cmp' },
}
```
**Rocks.nvim**:
`Minuet` is available on luarocks.org. Simply run `Rocks install
minuet-ai.nvim` to install it like any other luarocks package.
**Setting up with virtual text**:
```lua
require('minuet').setup {
virtualtext = {
auto_trigger_ft = {},
keymap = {
-- accept whole completion
accept = '<A-A>',
-- accept one line
accept_line = '<A-a>',
-- accept n lines (prompts for number)
-- e.g. "A-z 2 CR" will accept 2 lines
accept_n_lines = '<A-z>',
-- Cycle to prev completion item, or manually invoke completion
prev = '<A-[>',
-- Cycle to next completion item, or manually invoke completion
next = '<A-]>',
dismiss = '<A-e>',
},
},
}
```
**Setting up with nvim-cmp**:
<details>
```lua
require('cmp').setup {
sources = {
{
-- Include minuet as a source to enable autocompletion
{ name = 'minuet' },
-- and your other sources
}
},
performance = {
-- It is recommended to increase the timeout duration due to
-- the typically slower response speed of LLMs compared to
-- other completion sources. This is not needed when you only
-- need manual completion.
fetching_timeout = 2000,
},
}
-- If you wish to invoke completion manually,
-- The following configuration binds `A-y` key
-- to invoke the configuration manually.
require('cmp').setup {
mapping = {
["<A-y>"] = require('minuet').make_cmp_map()
-- and your other keymappings
},
}
```
</details>
**Setting up with blink-cmp**:
<details>
```lua
require('blink-cmp').setup {
keymap = {
-- Manually invoke minuet completion.
['<A-y>'] = require('minuet').make_blink_map(),
},
sources = {
-- Enable minuet for autocomplete
default = { 'lsp', 'path', 'buffer', 'snippets', 'minuet' },
-- For manual completion only, remove 'minuet' from default
providers = {
minuet = {
name = 'minuet',
module = 'minuet.blink',
score_offset = 8, -- Gives minuet higher priority among suggestions
},
},
},
-- Recommended to avoid unnecessary request
completion = { trigger = { prefetch_on_insert = false } },
}
```
</details>
**LLM Provider Examples**:
**Deepseek**:
```lua
-- you can use deepseek with both openai_fim_compatible or openai_compatible provider
require('minuet').setup {
provider = 'openai_fim_compatible',
provider_options = {
openai_fim_compatible = {
api_key = 'DEEPSEEK_API_KEY',
name = 'deepseek',
optional = {
max_tokens = 256,
top_p = 0.9,
},
},
},
}
-- or
require('minuet').setup {
provider = 'openai_compatible',
provider_options = {
openai_compatible = {
end_point = 'https://api.deepseek.com/v1/chat/completions',
api_key = 'DEEPSEEK_API_KEY',
name = 'deepseek',
optional = {
max_tokens = 256,
top_p = 0.9,
},
},
},
}
```

View File

@ -0,0 +1,172 @@
# Minuet AI
Minuet AI在您的代码中翩翩起舞挥洒智能 💃。
`Minuet-ai` 将小步舞曲的优雅与和谐带入您的编码流程。正如舞者在小步舞曲中舞动一样。
# 特性
- 基于 AI 的代码补全,提供双重模式:
- 针对代码补全任务,为基于聊天的 LLMs 提供专门的提示和各种增强功能。
- 针对兼容的模型DeepSeek、Codestral、Qwen 等)提供中间填充 (FIM) 补全。
- 支持多种 AI 提供商OpenAI、Claude、Gemini、Codestral、Ollama 和兼容 OpenAI 的服务)。
- 可自定义配置选项。
- 支持流式传输,即使使用较慢的 LLMs 也能实现补全的交付。
- 支持 `nvim-cmp`、`blink-cmp`、`virtual text` 前端。
# 要求
- Neovim 0.10+。
- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
- 可选: [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
- 可选: [blink.cmp](https://github.com/Saghen/blink.cmp)
- 至少一个受支持的 AI 提供商的 API 密钥
# 安装
**Lazy.nvim**
```lua
specs = {
{
'milanglacier/minuet-ai.nvim',
config = function()
require('minuet').setup {
-- 在此处配置您的选项
}
end,
},
{ 'nvim-lua/plenary.nvim' },
-- 可选,如果您使用 virtual-text 前端,则不需要 nvim-cmp。
{ 'hrsh7th/nvim-cmp' },
-- 可选,如果您使用 virtual-text 前端,则不需要 blink。
{ 'Saghen/blink.cmp' },
}
```
**Rocks.nvim**
`Minuet` 可在 luarocks.org 上获取。只需运行 `Rocks install minuet-ai.nvim` 即可像安装其他 luarocks 包一样安装它。
**使用 virtual text 进行设置:**
```lua
require('minuet').setup {
virtualtext = {
auto_trigger_ft = {},
keymap = {
-- 接受完整补全
accept = '<A-A>',
-- 接受一行
accept_line = '<A-a>',
-- 接受 n 行(提示输入数字)
-- 例如“A-z 2 CR”将接受 2 行
accept_n_lines = '<A-z>',
-- 切换到上一个补全项,或手动调用补全
prev = '<A-[>',
-- 切换到下一个补全项,或手动调用补全
next = '<A-]>',
dismiss = '<A-e>',
},
},
}
```
**使用 nvim-cmp 进行设置:**
<details>
```lua
require('cmp').setup {
sources = {
{
-- 包含 minuet 作为源以启用自动补全
{ name = 'minuet' },
-- 和您的其他来源
}
},
performance = {
-- 建议增加超时时间因为与其他补全来源相比LLMs 的响应速度通常较慢。如果您只需要手动补全,则不需要此设置。
fetching_timeout = 2000,
},
}
-- 如果你希望手动调用补全,
-- 以下配置将 `A-y` 键绑定到手动调用配置。
require('cmp').setup {
mapping = {
["<A-y>"] = require('minuet').make_cmp_map()
-- 和您的其他键映射
},
}
```
</details>
**使用 blink-cmp 进行设置:**
<details>
```lua
require('blink-cmp').setup {
keymap = {
-- 手动调用 minuet 补全。
['<A-y>'] = require('minuet').make_blink_map(),
},
sources = {
-- 启用 minuet 进行自动补全
default = { 'lsp', 'path', 'buffer', 'snippets', 'minuet' },
-- 仅对于手动补全,从默认值中删除 'minuet'
providers = {
minuet = {
name = 'minuet',
module = 'minuet.blink',
score_offset = 8, -- 在建议中赋予 minuet 更高的优先级
},
},
},
-- 建议避免不必要的请求
completion = { trigger = { prefetch_on_insert = false } },
}
```
</details>
**LLM 提供商示例:**
**Deepseek**
```lua
-- 你可以使用 openai_fim_compatible 或 openai_compatible 提供商来使用 deepseek
require('minuet').setup {
provider = 'openai_fim_compatible',
provider_options = {
openai_fim_compatible = {
api_key = 'DEEPSEEK_API_KEY',
name = 'deepseek',
optional = {
max_tokens = 256,
top_p = 0.9,
},
},
},
}
-- 或者
require('minuet').setup {
provider = 'openai_compatible',
provider_options = {
openai_compatible = {
end_point = 'https://api.deepseek.com/v1/chat/completions',
api_key = 'DEEPSEEK_API_KEY',
name = 'deepseek',
optional = {
max_tokens = 256,
top_p = 0.9,
},
},
},
}
```