Merge pull request #83 from wenjinnn/main

doc: add `olimorris/codecompanion.nvim`
This commit is contained in:
Huang Panpan 2025-01-22 15:22:50 +08:00 committed by GitHub
commit ef16d94fa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 205 additions and 0 deletions

View File

@ -174,6 +174,11 @@ English/[简体中文](https://github.com/deepseek-ai/awesome-deepseek-integrati
<td> <a href="docs/llm.nvim/README.md"> llm.nvim </a> </td>
<td> A free large language model(LLM) plugin that allows you to interact with LLM in Neovim. Supports any LLM, such as Deepseek, GPT, GLM, Kimi or local LLMs (such as ollama). </td>
</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/codecompanion.nvim/README.md"> codecompanion.nvim </a> </td>
<td> AI-powered coding, seamlessly in Neovim. </td>
</tr>
</table>
### JetBrains Extensions

View File

@ -157,6 +157,11 @@
<td> <a href="docs/llm.nvim/README.md"> llm.nvim </a> </td>
<td> 免费的大语言模型插件让你在Neovim中与大模型交互支持任意一款大模型比如DeepseekGPTGLMkimi或者本地运行的大模型(比如ollama) </td>
</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/codecompanion.nvim/README.md"> codecompanion.nvim </a> </td>
<td> AI 驱动的编码,在 Neovim 中无缝集成. </td>
</tr>
</table>
### JetBrains 插件

View File

@ -0,0 +1,97 @@
# [codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim)
> AI-powered coding, seamlessly in Neovim
**codecompanion.nvim** is a productivity tool which streamlines how you develop with LLMs, in Neovim.
## Features
- :speech_balloon: [Copilot Chat](https://github.com/features/copilot) meets [Zed AI](https://zed.dev/blog/zed-ai), in Neovim
- :electric_plug: Support for Anthropic, Copilot, Gemini, Ollama, OpenAI, Azure OpenAI, HuggingFace and xAI LLMs (or bring your own!)
- :rocket: Inline transformations, code creation and refactoring
- :robot: Variables, Slash Commands, Agents/Tools and Workflows to improve LLM output
- :sparkles: Built in prompt library for common tasks like advice on LSP errors and code explanations
- :building_construction: Create your own custom prompts, Variables and Slash Commands
- :books: Have multiple chats open at the same time
- :muscle: Async execution for fast performance
## Installation
First, Navigate to the nvim configuration folder (default on Linux is `~/.config/nvim`)
### Install via `lazy.nvim`
Then to the `lua/plugins` folder. Create a file named `init.lua` and add the following content:
```lua
return {
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("codecompanion").setup({
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "https://api.deepseek.com",
api_key = "YOUR_API_KEY",
},
})
end,
},
strategies = {
chat = { adapter = "deepseek", },
inline = { adapter = "deepseek" },
agent = { adapter = "deepseek" },
},
})
end
}
```
Restart nvim, and `lazy.nvim` should automatically download and install the codecompanion.nvim plugin and its dependencies based on the above file.
### Install via `mini.deps`
Add the following content to your `init.lua`:
```lua
local add, later = MiniDeps.add, MiniDeps.later
later(function()
add({
source = "olimorris/codecompanion.nvim",
depends = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
})
require("codecompanion").setup({
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "https://api.deepseek.com",
api_key = "YOUR_API_KEY",
},
})
end,
},
strategies = {
chat = { adapter = "deepseek", },
inline = { adapter = "deepseek" },
agent = { adapter = "deepseek" },
},
})
end)
```
Restart nvim, and `mini.deps` should also automatically download and install the codecompanion.nvim plugin.
### Other Installation Methods
https://codecompanion.olimorris.dev/installation.html
## Usage
https://codecompanion.olimorris.dev/usage/introduction.html

View File

@ -0,0 +1,98 @@
# [codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim)
> AI 驱动的编码,在 Neovim 中无缝集成
**codecompanion.nvim** 是一个提高生产力的工具,它简化了在 Neovim 中使用大型语言模型LLM进行开发的方式。
## 特性
- :speech_balloon: 在 Neovim 中,[Copilot Chat](https://github.com/features/copilot) 与 [Zed AI](https://zed.dev/blog/zed-ai) 的结合
- :electric_plug: 支持 Anthropic、Copilot、Gemini、Ollama、OpenAI、Azure OpenAI、HuggingFace 和 xAI LLM或自定义 LLM
- :rocket: 内联变换、代码生成与重构
- :robot: 通过变量、斜杠命令、代理/工具和工作流改善 LLM 输出
- :sparkles: 内置常用任务的提示词,例如 LSP 错误的建议和代码解释
- :building_construction: 创建自定义提示、变量和斜杠命令
- :books: 同时打开多个对话
- :muscle: 异步执行,提供快速的性能
## 安装
首先,导航到 Neovim 配置文件夹默认情况下Linux 上的路径是 `~/.config/nvim`)。
### 通过 `lazy.nvim` 安装
然后进入 `lua/plugins` 文件夹。创建一个名为 `init.lua` 的文件,并添加以下内容:
```lua
return {
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("codecompanion").setup({
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "https://api.deepseek.com",
api_key = "YOUR_API_KEY",
},
})
end,
},
strategies = {
chat = { adapter = "deepseek", },
inline = { adapter = "deepseek" },
agent = { adapter = "deepseek" },
},
})
end
}
```
重新启动 Neovim`lazy.nvim` 应该会自动下载并安装 `codecompanion.nvim` 插件及其依赖项。
### 通过 `mini.deps` 安装
将以下内容添加到你的 `init.lua`
```lua
local add, later = MiniDeps.add, MiniDeps.later
later(function()
add({
source = "olimorris/codecompanion.nvim",
depends = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
})
require("codecompanion").setup({
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "https://api.deepseek.com",
api_key = "YOUR_API_KEY",
},
})
end,
},
strategies = {
chat = { adapter = "deepseek", },
inline = { adapter = "deepseek" },
agent = { adapter = "deepseek" },
},
})
end)
```
重新启动 Neovim`mini.deps` 应该会自动下载并安装 `codecompanion.nvim` 插件。
### 其他安装方法
https://codecompanion.olimorris.dev/installation.html
## 使用
https://codecompanion.olimorris.dev/usage/introduction.html