Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 14 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,42 @@
# 🤖 ECA Neovim Plugin
# ECA Neovim Plugin

<img width="800" alt="demo" src="https://github.com/user-attachments/assets/d8417f8d-54cd-45fe-88a4-5e8dc245d73d" />

A modern Neovim plugin that integrates [ECA (Editor Code Assistant)](https://eca.dev/) directly into the editor for an intuitive, streaming AI experience.
A lightweight Neovim plugin that embeds [ECA (Editor Code Assistant)](https://eca.dev/) directly into your editor. It is designed to be very simple, while remaining highly customizable.

## ✨ Features
- 🤖 Integrated AI chat in Neovim
- 📁 Add files, directories and selections as context
- 🚀 Automatic ECA server download and start
- 🎨 Clean sidebar UI with Markdown rendering
- ⌨️ Intuitive defaults (Ctrl+S to send, Enter for newline)
- 🔧 Highly configurable windows, keymaps and behavior
- 📊 Usage and status feedback
> Status: **Work in Progress** — we’re actively developing this plugin and would love feedback, bug reports, and contributions. If you’d like to help, check out [Development & contributing](./docs/development.md) or open an issue/PR.

## ⚡ Quick Start
1. Install via your plugin manager (see Installation below)
2. Restart Neovim
3. Run `:EcaChat` or press `<leader>ec`
4. Type your message and press `Ctrl+S`
5. Add context with `:EcaAddFile` or `:EcaAddSelection`
## Quick Start

> Requires Neovim >= 0.8.0, curl and unzip.

## 📚 Documentation
1. Install via your plugin manager (see Installation below)
2. Run `:EcaChat` or press `<leader>ec`
3. Type your message and press `Ctrl+S`


## Documentation
- [Installation and system requirements](./docs/installation.md)
- [Usage guide (commands, keymaps, tips)](./docs/usage.md)
- [Configuration reference and presets](./docs/configuration.md)
- [Troubleshooting common issues](./docs/troubleshooting.md)
- [Development & contributing](./docs/development.md)

## 🔗 Useful Links
## Useful Links
- [Official ECA Website](https://eca.dev/)
- [ECA Documentation](https://docs.eca.dev/)
- [VS Code Plugin](https://marketplace.visualstudio.com/items?itemName=editor-code-assistant.eca-vscode)
- [ECA GitHub](https://github.com/editor-code-assistant)

## 📄 License
## License
Apache License 2.0 — see [LICENSE](LICENSE) for details.

## 🙏 Acknowledgments
Inspired by:
- [avante.nvim](https://github.com/yetone/avante.nvim) — base structure and UI concepts
- [eca-vscode](https://github.com/editor-code-assistant/eca-vscode) — ECA server integration

---

<div align="center">

Made with ❤️ for the Neovim community
Made for the Neovim community

[Give a star if this plugin was useful!](https://github.com/editor-code-assistant/eca-nvim)
[Give a star if this plugin was useful](https://github.com/editor-code-assistant/eca-nvim)

</div>
229 changes: 142 additions & 87 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,102 +6,162 @@ ECA is highly configurable. This page lists all available options and provides c

```lua
require("eca").setup({
-- === BASIC SETTINGS ===
-- === SERVER ===

-- Enable debug mode (shows detailed logs)
debug = false,

-- Path to ECA binary (empty = automatic download)
-- Path to the ECA binary
-- - Empty string: automatically download & manage the binary
-- - Custom path: use your own binary
server_path = "",

-- Extra arguments for ECA server
server_args = "--log-level info",
-- Extra arguments passed to the ECA server (eca start ...)
server_args = "",

-- === LOGGING ===
log = {
-- Where to display logs inside Neovim
-- "split" - use a split window
-- "float" - use a floating window
-- "none" - disable the log window
display = "split",

-- Minimum log level to record
-- vim.log.levels.TRACE | DEBUG | INFO | WARN | ERROR
level = vim.log.levels.INFO,

-- Usage string format (tokens/cost)
usage_string_format = "{messageCost} / {sessionCost}",
-- Optional file path for persistent logs (empty = disabled)
file = "",

-- Maximum log file size before ECA warns you (in MB)
max_file_size_mb = 10,
},

-- === BEHAVIOR ===
behavior = {
-- Set keymaps automatically
-- Set default keymaps automatically
auto_set_keymaps = true,

-- Focus sidebar automatically when opening
-- Focus the ECA sidebar when opening it
auto_focus_sidebar = true,

-- Start server automatically
-- Automatically start the server on plugin setup
auto_start_server = false,

-- Download server automatically if not found
-- Automatically download the server if not found
auto_download = true,

-- Show status updates in notifications
-- Show status updates (startup, downloads, errors) as notifications
show_status_updates = true,
},

-- === KEY MAPPINGS ===
mappings = {
chat = "<leader>ec", -- Open chat
focus = "<leader>ef", -- Focus sidebar
toggle = "<leader>et", -- Toggle sidebar
-- === CONTEXT ===
context = {
-- Automatically attach repo context (repoMap) when starting new chats
auto_repo_map = true,
},

-- === CHAT ===
chat = {
headers = {
user = "> ",
assistant = "",
},
welcome = {
-- If non-empty, overrides server-provided welcome message
message = "",
-- Tips appended under the welcome (set {} to disable)
tips = {
"Type your message and use CTRL+s to send",
},
},
-- === TODOS PANEL ===
todos = {
enabled = true, -- Enable or disable todos integration
max_height = 5, -- Maximum height for the todos container
},

-- === SELECTED CODE PANEL ===
selected_code = {
enabled = true, -- Show currently selected code in the UI
max_height = 8, -- Maximum height for the selected code container
},

-- === WINDOW SETTINGS ===
-- === KEY MAPPINGS ===
mappings = {
chat = "<leader>ec", -- Open chat
focus = "<leader>ef", -- Focus sidebar
toggle = "<leader>et",-- Toggle sidebar
},

-- === WINDOWS & UI ===
windows = {
-- Automatic line wrapping
-- Automatic line wrapping in ECA buffers
wrap = true,

-- Width as percentage of screen (1-100)
-- Width as percentage of Neovim columns (1–100)
width = 40,

-- Sidebar header configuration
sidebar_header = {
enabled = true,
align = "center", -- "left", "center", "right"
align = "center", -- "left", "center", "right"
rounded = true,
},

-- Input area configuration
input = {
prefix = "> ", -- Input line prefix
height = 8, -- Input window height
prefix = "> ", -- Input line prefix
height = 8, -- Input window height (lines)

-- Maximum length for web context names in the input area
web_context_max_len = 20,
},

-- Edit window configuration
edit = {
border = "rounded", -- "none", "single", "double", "rounded"
start_insert = true, -- Start in insert mode
border = "rounded", -- "none", "single", "double", "rounded"
start_insert = true, -- Start in insert mode
},

-- Ask window configuration
ask = {
floating = false, -- Use floating window
start_insert = true, -- Start in insert mode
border = "rounded",
focus_on_apply = "ours", -- "ours" or "theirs"
-- Usage line configuration (token / cost display)
usage = {
-- Supported placeholders:
-- {session_tokens} - raw session token count (e.g. "30376")
-- {limit_tokens} - raw token limit (e.g. "400000")
-- {session_tokens_short} - shortened session tokens (e.g. "30k")
-- {limit_tokens_short} - shortened token limit (e.g. "400k")
-- {session_cost} - session cost (e.g. "0.09")
-- Default: "30k / 400k ($0.09)" ->
-- "{session_tokens_short} / {limit_tokens_short} (${session_cost})"
format = "{session_tokens_short} / {limit_tokens_short} (${session_cost})",
},
},

-- === HIGHLIGHTS AND COLORS ===
highlights = {
diff = {
current = "DiffText", -- Highlight for current diff
incoming = "DiffAdd", -- Highlight for incoming diff
-- Chat window & behavior
chat = {
-- Prefixes for each speaker
headers = {
user = "> ",
assistant = "",
},

-- Welcome message configuration
welcome = {
-- If non-empty, overrides the server-provided welcome message
message = "",

-- Tips appended under the welcome (set {} to disable)
tips = {
"Type your message and use CTRL+s to send",
},
},

-- Tool call display settings
tool_call = {
icons = {
success = "✅", -- Shown when a tool call succeeds
error = "❌", -- Shown when a tool call fails
running = "⏳", -- Shown while a tool call is running
expanded = "▼", -- Arrow when the tool call details are expanded
collapsed = "▶", -- Arrow when the tool call details are collapsed
},
diff = {
collapsed_label = "+ view diff", -- Label when the diff is collapsed
expanded_label = "- view diff", -- Label when the diff is expanded
expanded = false, -- When true, tool diffs start expanded
},
},

-- Reasoning ("Thinking") block behavior
reasoning = {
expanded = false, -- When true, "Thinking" blocks start expanded
running_label = "Thinking...", -- Label while reasoning is running
finished_label = "Thought", -- Base label when reasoning is finished
},
},
},
})
Expand All @@ -111,21 +171,27 @@ require("eca").setup({

## Presets

These examples show how to override just a subset of the configuration.

### Minimalist
```lua
require("eca").setup({
behavior = { show_status_updates = false },
windows = { width = 30 },
chat = {
headers = {
user = "> ",
assistant = "",
behavior = {
show_status_updates = false,
},
windows = {
width = 30,
chat = {
headers = {
user = "> ",
assistant = "",
},
},
},
})
```

### Visual/UX focused
### Visual / UX focused
```lua
require("eca").setup({
behavior = { auto_focus_sidebar = true },
Expand All @@ -134,11 +200,14 @@ require("eca").setup({
wrap = true,
sidebar_header = { enabled = true, rounded = true },
input = { prefix = "💬 ", height = 10 },
},
chat = {
headers = {
user = "## 👤 You\n\n",
assistant = "## 🤖 ECA\n\n",
chat = {
headers = {
user = "## 👤 You\n\n",
assistant = "## 🤖 ECA\n\n",
},
reasoning = {
expanded = true,
},
},
},
})
Expand All @@ -147,35 +216,21 @@ require("eca").setup({
### Development
```lua
require("eca").setup({
debug = true,
server_args = "--log-level debug",
behavior = {
auto_start_server = true,
show_status_updates = true,
},
mappings = {
chat = "<F12>",
toggle = "<F11>",
focus = "<F10>",
},
})
```

### Performance-oriented
```lua
require("eca").setup({
behavior = {
auto_focus_sidebar = false,
show_status_updates = false,
log = {
level = vim.log.levels.DEBUG,
display = "split",
},
windows = { width = 25 },
})
```

---

## Notes
- Set `server_path` if you prefer using a local ECA binary.
- For noisy environments, disable `show_status_updates`.
- Use the `log` block to control verbosity and where logs are written.
- `context.auto_repo_map` controls whether repo context is attached automatically.
- `todos` and `selected_code` can be disabled entirely if you prefer a simpler UI.
- Adjust `windows.width` to fit your layout.
- Keymaps can be set manually by turning off `auto_set_keymaps`.
- Keymaps can be set manually by turning off `behavior.auto_set_keymaps` and defining your own mappings.
- The `windows.usage.format` string controls how token and cost usage are displayed.
Loading