Everything you need to get productive with ECA inside Neovim.
- Install the plugin using any package manager
- Restart Neovim or reload your configuration
- Open a file you want to analyze
- Run
:EcaChator press<leader>ec - On first run, the server downloads automatically
- Type your question and press
Ctrl+Sto send
| Command | Description | Example |
|---|---|---|
:EcaChat |
Open ECA chat sidebar | :EcaChat |
:EcaToggle |
Toggle sidebar visibility | :EcaToggle |
:EcaFocus |
Focus ECA sidebar | :EcaFocus |
:EcaClose |
Close ECA sidebar | :EcaClose |
:EcaChatAddFile [file] |
Add a file as context for the current chat | :EcaChatAddFile lua/eca/sidebar.lua |
:EcaChatRemoveFile [file] |
Remove a file context from the current chat | :EcaChatRemoveFile lua/eca/sidebar.lua |
:EcaChatAddSelection |
Add current visual selection as a file-range context | :EcaChatAddSelection |
:EcaChatAddUrl |
Add a URL as "web" context | :EcaChatAddUrl |
:EcaChatListContexts |
List active contexts for the current chat | :EcaChatListContexts |
:EcaChatClearContexts |
Clear all contexts for the current chat | :EcaChatClearContexts |
:EcaServerStart |
Start ECA server manually | :EcaServerStart |
:EcaServerStop |
Stop ECA server | :EcaServerStop |
:EcaServerRestart |
Restart ECA server | :EcaServerRestart |
:EcaSend <message> |
Send message directly (without opening chat) | :EcaSend Explain this function |
Deprecated aliases (still available but log a warning): :EcaAddFile, :EcaAddSelection, :EcaRemoveContext, :EcaListContexts, :EcaClearContexts. Prefer the :EcaChat* variants above.
| Shortcut | Action |
|---|---|
<leader>ec |
Open/focus chat |
<leader>ef |
Focus on sidebar |
<leader>et |
Toggle sidebar |
| Shortcut | Action | Context |
|---|---|---|
Ctrl+S |
Send message | Insert/Normal mode |
Enter |
New line | Insert mode |
Esc |
Exit insert mode | Insert mode |
- Type in the input line starting with
> - Press
Enterto insert a new line - Press
Ctrl+Sto send - Responses stream in real time
Explain what this function doesOptimize this code:
[code will be added as context]How can I improve the performance of this function?
Consider readability and maintainability.:EcaChatAddFileAdds the current buffer as a file context for the active chat.
:EcaChatAddFile src/main.lua
:EcaChatAddFile /full/path/to/file.jsPass a path to add that file as context. Relative paths are resolved to absolute paths.
- Select code in visual mode (
v,V, orCtrl+v) - Run
:EcaChatAddSelection - The selected lines will be added as a file-range context (file + line range)
:EcaChatAddUrlPrompts for a URL and adds it as a web context. The URL label in the input is truncated for display, but the full URL is sent to the server.
:EcaChatListContexts " show all active contexts
:EcaChatClearContexts " remove all contexts from the current chat
:EcaChatRemoveFile " remove the current file from contexts:EcaChatAddFile
:EcaChatAddFile src/utils.lua
:EcaChatAddFile src/config.lua
:EcaChatAddFile tests/test_utils.luaWhen the sidebar is open, the chat input buffer has two parts:
- First line – context area: shows one label per active context (e.g.
sidebar.lua,sidebar.lua:25-50or a truncated URL). - Below that – message input: your prompt, prefixed by
>(configurable viawindows.input.prefix).
You normally do not need to edit the first line manually, but you can:
- Remove a single context: move the cursor to the corresponding label on the first line and delete it; the context is removed from the current chat while your message text is preserved.
- Clear all contexts: delete the whole first line; ECA restores an empty context line and clears all contexts.
No contexts yet
@
> Explain this code
Single file context
@sidebar.lua @
> Explain this code
Two contexts (file + line range)
@sidebar.lua @sidebar.lua:25-50 @
> Explain this selection
If you now delete just the sidebar.lua:25-50 label on the first line, only that context is removed:
@sidebar.lua @
> Explain this selection
If instead you delete the entire first line, all contexts are cleared. ECA recreates an empty context line internally and keeps your input text:
@
> Explain this selection
When typing paths directly with @ to trigger completion, the input might briefly look like:
@lua/eca/sidebar.lua
> Input text
After confirming a completion item, that @... reference is turned into a context entry and shown as a short label (for example sidebar.lua ) in the context area.
Inside the input (filetype eca-input):
- Typing
@or#followed by part of a path triggers context completion (via the providedcmp/blinksources). - Selecting a completion item in the context area line automatically adds that item as a context for the current chat and shows it as a label on the first line.
Semantics of the two prefixes:
@prefix – inline content:@path/to/file.luameans: "resolve this to the file contents and send those contents to the model".- The server expands the
@reference to the actual file content before forming the prompt.
#prefix – path reference:#path/to/file.luameans: "send the full absolute path; the model will fetch and read the file itself".- The server keeps it as a path reference in the prompt so the model can look up the file by path.
In both cases, when you send a message any occurrences like:
@relative/path/to/file.lua
#another/path
are first expanded to absolute paths on the Neovim side (including ~ expansion). The difference is how the server then interprets @ (inline file contents) versus # (path-only reference that the model resolves).
> Analyze this file and tell me if there are performance issues> This code is returning an error. Can you help me identify the problem?
[add the file as context first]> Generate JSDoc documentation for these functions> How can I refactor this code to use ES6+ features?> Create unit tests for this function> Suggest improvements to optimize this algorithm- Open the file you want to analyze
- Add as context:
:EcaChatAddFile - Open chat:
<leader>ec - Ask your question:
> Explain what this function does and how I can improve it - Send with
Ctrl+S - Read the response and implement suggestions
- Continue the conversation for clarifications
" Restart if there are issues
:EcaServerRestart
" Stop temporarily
:EcaServerStop
" Start again
:EcaServerStart" Send message directly (without opening chat)
:EcaSend Explain this line of code
" Focus on chat if already open
:EcaFocus
" Toggle chat visibility
:EcaToggle- Use
:EcaChatAddFilebefore asking about specific code - Combine contexts: add multiple related files
- Be specific: detailed questions generate better responses
- Use Markdown: ECA understands Markdown formatting
> Analyze this code and suggest improvements:
- Performance
- Readability
- Best practices
- Possible bugs> Create comprehensive unit tests for this function, including:
- Success cases
- Error cases
- Edge cases
- Mocks if necessary> Generate complete documentation for this module:
- General description
- Parameters and types
- Usage examples
- Possible exceptions-- More convenient shortcuts
vim.keymap.set("n", "<F12>", ":EcaChat<CR>")
vim.keymap.set("n", "<F11>", ":EcaToggle<CR>")
vim.keymap.set("v", "<leader>ea", ":EcaChatAddSelection<CR>")
-- Shortcut to add current file
vim.keymap.set("n", "<leader>ef", function()
vim.cmd("EcaChatAddFile " .. vim.fn.expand("%"))
end)