Flemma Neovim AI助手 是 AI Skill Hub 本期精选AI工具之一。综合评分 7.0 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
Neovim内置的AI工作区插件,集成ChatGPT和Claude等大模型能力。每个对话都是用户拥有的独立文档,支持代码编辑、文档生成等开发场景,适合需要在编辑器中快速调用AI的开发者。
Flemma Neovim AI助手 是一款基于 Lua 开发的开源工具,专注于 Neovim插件、ChatGPT、Claude 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Neovim内置的AI工作区插件,集成ChatGPT和Claude等大模型能力。每个对话都是用户拥有的独立文档,支持代码编辑、文档生成等开发场景,适合需要在编辑器中快速调用AI的开发者。
Flemma Neovim AI助手 是一款基于 Lua 开发的开源工具,专注于 Neovim插件、ChatGPT、Claude 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 克隆仓库 git clone https://github.com/Flemma-Dev/flemma.nvim cd flemma.nvim # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 flemma.nvim --help # 基本运行 flemma.nvim [options] <input> # 详细使用说明请查阅文档 # https://github.com/Flemma-Dev/flemma.nvim
# flemma.nvim 配置说明 # 查看配置选项 flemma.nvim --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export FLEMMA.NVIM_CONFIG="/path/to/config.yml"
An AI workspace inside Neovim where every conversation is a document you own.
https://github.com/user-attachments/assets/db3bad82-9fcc-4cb7-989b-a63c6ee149d3
[!IMPORTANT] Actively Evolving. See the roadmap for what's coming next. Pin a tag if you need a stable target.
---
-- lazy.nvim (any plugin manager works):
{ "Flemma-Dev/flemma.nvim", opts = {} }
-- If your plugin manager doesn't auto-call setup(), add this to your config:
require("flemma").setup({})
export ANTHROPIC_API_KEY="sk-ant-..." # or OPENAI_API_KEY, MOONSHOT_API_KEY
Create a file ending in .chat. Type your message after @You:. Press <kbd>Ctrl-]</kbd>.
Requirements: Neovim 0.11+, curl, Markdown Tree-sitter grammar. Optional: bwrap for sandboxing (Linux), file for MIME detection.
<details> <summary><strong>Setting up credentials</strong></summary>
Flemma never accepts API keys in your Lua config -- credentials stay in environment variables or your platform's secure keyring.
Environment variables (simplest approach):
| Provider | Variable |
|---|---|
| Anthropic | ANTHROPIC_API_KEY |
| OpenAI | OPENAI_API_KEY |
| Moonshot | MOONSHOT_API_KEY |
| Vertex AI | VERTEX_AI_ACCESS_TOKEN (or service-account flow below) |
Linux keyring (Secret Service) -- store once, reuse across all Neovim sessions:
secret-tool store --label="Anthropic API Key" service anthropic key api
secret-tool store --label="OpenAI API Key" service openai key api
secret-tool store --label="Moonshot API Key" service moonshot key api
macOS Keychain is also supported.
Vertex AI requires a Google Cloud service account:
VERTEX_SERVICE_ACCOUNT='{"type": "..."}', or store them in the Linux keyring with secret-tool store --label="Vertex AI Service Account" service vertex key api project_id your-project.gcloud is on your $PATH -- Flemma uses gcloud auth print-access-token to refresh tokens.project_id in your config or via :Flemma switch vertex gemini-3.1-pro-preview project_id=my-project.Flemma tries each source in order and uses the first one that returns a credential. When everything fails, the notification tells you exactly which sources were tried and why each one couldn't help. You can also add custom sources for tools like Bitwarden or 1Password -- read more in extending.md.
</details>
---
| Mode | Key | Action |
|---|---|---|
| Normal<br />Insert | <kbd>Ctrl-]</kbd> | Send to provider (or advance the tool approval cycle) |
| Normal | <kbd>Ctrl-C</kbd> | Cancel (double-tap to cancel all) |
| Normal | <kbd>Alt-Enter</kbd> | Execute the tool under cursor |
| Normal | <kbd>Alt-B</kbd> | Move executing tool to background |
| Normal | ]m / [m | Next / previous message |
| Normal | <kbd>Space</kbd> | Toggle message fold |
| Normal | zy / zY | Fold intermediate messages in current / all turns |
| Normal | yoe | Toggle Markdown conceal ([oe / ]oe to set on/off) |
| Operator | im / am | Inner / around message text objects |
---
Flemma works without arguments -- require("flemma").setup({}) uses sensible defaults. Here's a practical starting point:
require("flemma").setup({
provider = "anthropic", -- "anthropic" | "openai" | "vertex" | "moonshot"
thinking = "high", -- unified across all providers
presets = {
["$fast"] = "vertex gemini-2.5-flash thinking=minimal",
["$opus"] = "anthropic claude-opus-4-6 thinking=max",
},
sandbox = { backend = "required" }, -- warn if no sandbox backend is available
editing = { auto_write = true }, -- save .chat files after each response
})
Individual .chat files can override any of these settings. Detailed references:
---
<details> <summary><strong>Can I use different models for different conversations?</strong></summary>
Yes. Each .chat file can set its own provider, model, and parameters. You can also switch mid-conversation with :Flemma switch openai gpt-5. Read more in configuration.md.
</details>
<details> <summary><strong>Can I attach files, images, or PDFs?</strong></summary>
Yes. Type @./path/to/file in your message and Flemma inlines the content before sending. Images and PDFs are base64-encoded and sent as multipart attachments where the provider supports it. MIME types are detected automatically. Read more in templates.md.
</details>
<details> <summary><strong>Can I build reusable prompt templates?</strong></summary>
Yes. A .chat file with a system prompt, variables, and expressions becomes a template. Define variables in a code block at the top of the file and reference them throughout your messages. You can also include other files and compose system prompts from building blocks. Read more in templates.md.
</details>
<details> <summary><strong>Can I control which tools the agent can use?</strong></summary>
Yes. Tools are governed by an approval system with built-in presets ($standard for file tools, $readonly for read-only access). You can auto-approve specific tools, require manual review for others, or write custom approval logic. Each .chat file can override the global policy. Read more in tools.md.
</details>
<details> <summary><strong>How do I store API keys securely?</strong></summary>
Flemma checks environment variables first, then your platform keyring (Linux Secret Service or macOS Keychain), then gcloud for Vertex AI. You never have to put keys in a config file. Read more in extending.md.
</details>
<details> <summary><strong>Can I add my own tools or integrate with other systems?</strong></summary>
Yes. Register custom tools, approval resolvers, credential resolvers, sandbox backends, and more -- everything plugs in through registries. For MCP servers (Slack, Linear, GitHub, etc.), enable the built-in MCPorter integration -- see mcp.md. For custom Lua tools, read tools.md and extending.md.
</details>
<details> <summary><strong>Who made this?</strong></summary>
<img src="https://images.weserv.nl/?url=gravatar.com%2Favatar%2Fea3f8f366bb2aa0855db031884e3a8e8%3Fs%3D400%26d%3Drobohash%26r%3Dg&mask=circle" valign="middle" align="left" width="18" height="18" alt="Photo of @StanAngeloff"> @StanAngeloff. Flemma started as a personal tool for thinking, writing, and experimenting with AI inside Neovim. It's been used for everything from architecture documents and project planning to bedtime stories.
</details>
---
Start with :Flemma status. It shows a tree of everything Flemma knows about the current buffer -- provider, model, resolved parameters, sandbox state, enabled tools, approval policies, and which config layer set each value. Add verbose for the full picture. If something isn't working, this is the fastest way to find out why.
| Problem | Fix |
|---|---|
| Nothing happens on send | Buffer must end with .chat. Messages need @You: on its own line, content below. |
| Vertex refuses requests | Check parameters.vertex.project_id. Run gcloud auth print-access-token manually. |
| Sandbox blocks writes | :Flemma sandbox:status to check writable paths. |
| Keymaps clash | keymaps.enabled = false to disable all built-in mappings. |
| Temperature ignored | Thinking (default "high") disables temperature on Anthropic/OpenAI. Set thinking = false. |
---
轻量级Neovim AI插件,整合主流模型,文档所有权设计贴心。但社区规模小、维护活跃度一般,适合极简工作流爱好者。
该工具使用 AGPL-3.0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
⚠️ AGPL 3.0 — 最严格的 Copyleft,网络服务端使用也需开源,SaaS 使用受限。
经综合评估,Flemma Neovim AI助手 在AI工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | flemma-nvim |
| 原始描述 | 开源ChatGPT插件:An AI workspace inside Neovim where every conversation is a document you own.。⭐54 · Lua |
| Topics | Neovim插件ChatGPTClaude开发工具AI工作区 |
| GitHub | https://github.com/Flemma-Dev/flemma.nvim |
| License | AGPL-3.0 |
| 语言 | Lua |
收录时间:2026-05-22 · 更新时间:2026-05-30 · License:AGPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。