diff --git a/README.md b/README.md index e6140e7..567029b 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,11 @@ English/[简体中文](https://github.com/deepseek-ai/awesome-deepseek-integrati llm.nvim 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). + + Icon + codecompanion.nvim + AI-powered coding, seamlessly in Neovim. + ### JetBrains Extensions diff --git a/README_cn.md b/README_cn.md index d0f8285..187f5e4 100644 --- a/README_cn.md +++ b/README_cn.md @@ -152,6 +152,11 @@ llm.nvim 免费的大语言模型插件,让你在Neovim中与大模型交互,支持任意一款大模型,比如Deepseek,GPT,GLM,kimi或者本地运行的大模型(比如ollama) + + Icon + codecompanion.nvim + AI 驱动的编码,在 Neovim 中无缝集成. + ### JetBrains 插件 diff --git a/docs/codecompanion.nvim/README.md b/docs/codecompanion.nvim/README.md new file mode 100644 index 0000000..4e9eb28 --- /dev/null +++ b/docs/codecompanion.nvim/README.md @@ -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 diff --git a/docs/codecompanion.nvim/README_cn.md b/docs/codecompanion.nvim/README_cn.md new file mode 100644 index 0000000..01173ec --- /dev/null +++ b/docs/codecompanion.nvim/README_cn.md @@ -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