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
:EcaChat or press <leader>ec
- On first run, the server downloads automatically
- Type your question and press
Ctrl+S to send
| Command |
Description |
Example |
:EcaChat |
Opens ECA chat |
:EcaChat |
:EcaToggle |
Toggles sidebar visibility |
:EcaToggle |
:EcaFocus |
Focus on ECA sidebar |
:EcaFocus |
:EcaClose |
Closes ECA sidebar |
:EcaClose |
:EcaAddFile [file] |
Adds file as context |
:EcaAddFile src/main.lua |
:EcaAddSelection |
Adds current selection as context |
:EcaAddSelection |
:EcaServerStart |
Starts ECA server manually |
:EcaServerStart |
:EcaServerStop |
Stops ECA server |
:EcaServerStop |
:EcaServerRestart |
Restarts ECA server |
:EcaServerRestart |
:EcaSend <message> |
Sends message directly |
:EcaSend Explain this function |
| 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
Enter to insert a new line
- Press
Ctrl+S to send
- Responses stream in real time
Explain what this function does
Optimize this code:
[code will be added as context]
How can I improve the performance of this function?
Consider readability and maintainability.
:EcaAddFile src/main.lua
:EcaAddFile /full/path/to/file.js
- Select code in visual mode (
v, V, or Ctrl+v)
- Run
:EcaAddSelection
- Selected code will be added as context
:EcaAddFile src/utils.lua
:EcaAddFile src/config.lua
:EcaAddFile tests/test_utils.lua
> 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:
:EcaAddFile
- 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
:EcaAddFile before 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", ":EcaAddSelection<CR>")
-- Shortcut to add current file
vim.keymap.set("n", "<leader>ef", function()
vim.cmd("EcaAddFile " .. vim.fn.expand("%"))
end)