You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecated aliases (still available but log a warning): `:EcaAddFile`, `:EcaAddSelection`, `:EcaRemoveContext`, `:EcaListContexts`, `:EcaClearContexts`. Prefer the `:EcaChat*` variants above.
30
36
31
37
---
32
38
@@ -81,30 +87,134 @@ Consider readability and maintainability.
81
87
### Current file
82
88
83
89
```vim
84
-
:EcaAddFile
90
+
:EcaChatAddFile
85
91
```
86
92
93
+
Adds the current buffer as a file context for the active chat.
94
+
87
95
### Specific file
88
96
89
97
```vim
90
-
:EcaAddFile src/main.lua
91
-
:EcaAddFile /full/path/to/file.js
98
+
:EcaChatAddFile src/main.lua
99
+
:EcaChatAddFile /full/path/to/file.js
92
100
```
93
101
102
+
Pass a path to add that file as context. Relative paths are resolved to absolute paths.
103
+
94
104
### Code selection
95
105
96
106
1. Select code in visual mode (`v`, `V`, or `Ctrl+v`)
97
-
2. Run `:EcaAddSelection`
98
-
3. Selected code will be added as context
107
+
2. Run `:EcaChatAddSelection`
108
+
3. The selected lines will be added as a file-range context (file + line range)
109
+
110
+
### Web URLs
111
+
112
+
```vim
113
+
:EcaChatAddUrl
114
+
```
115
+
116
+
Prompts 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.
117
+
118
+
### Listing and clearing contexts
119
+
120
+
```vim
121
+
:EcaChatListContexts " show all active contexts
122
+
:EcaChatClearContexts " remove all contexts from the current chat
123
+
:EcaChatRemoveFile " remove the current file from contexts
124
+
```
99
125
100
126
### Multiple files
101
127
102
128
```vim
103
-
:EcaAddFile src/utils.lua
104
-
:EcaAddFile src/config.lua
105
-
:EcaAddFile tests/test_utils.lua
129
+
:EcaChatAddFile
130
+
:EcaChatAddFile src/utils.lua
131
+
:EcaChatAddFile src/config.lua
132
+
:EcaChatAddFile tests/test_utils.lua
133
+
```
134
+
135
+
### Context area in the input
136
+
137
+
When the sidebar is open, the chat input buffer has **two parts**:
138
+
139
+
1.**First line – context area**: shows one label per active context (e.g. `sidebar.lua `, `sidebar.lua:25-50 ` or a truncated URL).
140
+
2.**Below that – message input**: your prompt, prefixed by `> ` (configurable via `windows.input.prefix`).
141
+
142
+
You normally do not need to edit the first line manually, but you can:
143
+
144
+
-**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.
145
+
-**Clear all contexts**: delete the whole first line; ECA restores an empty context line and clears all contexts.
146
+
147
+
#### Examples
148
+
149
+
**No contexts yet**
150
+
151
+
```text
152
+
@
153
+
> Explain this code
154
+
```
155
+
156
+
**Single file context**
157
+
158
+
```text
159
+
@sidebar.lua @
160
+
> Explain this code
106
161
```
107
162
163
+
**Two contexts (file + line range)**
164
+
165
+
```text
166
+
@sidebar.lua @sidebar.lua:25-50 @
167
+
> Explain this selection
168
+
```
169
+
170
+
If you now delete just the `sidebar.lua:25-50 ` label on the first line, only that context is removed:
171
+
172
+
```text
173
+
@sidebar.lua @
174
+
> Explain this selection
175
+
```
176
+
177
+
If instead you delete the **entire first line**, all contexts are cleared. ECA recreates an empty context line internally and keeps your input text:
178
+
179
+
```text
180
+
@
181
+
> Explain this selection
182
+
```
183
+
184
+
When typing paths directly with `@` to trigger completion, the input might briefly look like:
185
+
186
+
```text
187
+
@lua/eca/sidebar.lua
188
+
> Input text
189
+
```
190
+
191
+
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.
192
+
193
+
### Context completion and `@` / `#` path shortcuts
194
+
195
+
Inside the input (filetype `eca-input`):
196
+
197
+
- Typing `@` or `#` followed by part of a path triggers context completion (via the provided `cmp`/`blink` sources).
198
+
- 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.
199
+
200
+
Semantics of the two prefixes:
201
+
202
+
-**`@` prefix** – *inline content*:
203
+
-`@path/to/file.lua` means: "resolve this to the file contents and send those contents to the model".
204
+
- The server expands the `@` reference to the actual file content before forming the prompt.
205
+
-**`#` prefix** – *path reference*:
206
+
-`#path/to/file.lua` means: "send the full absolute path; the model will fetch and read the file itself".
207
+
- The server keeps it as a path reference in the prompt so the model can look up the file by path.
208
+
209
+
In both cases, when you send a message any occurrences like:
210
+
211
+
```text
212
+
@relative/path/to/file.lua
213
+
#another/path
214
+
```
215
+
216
+
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).
217
+
108
218
---
109
219
110
220
## Common Use Cases
@@ -145,7 +255,7 @@ Consider readability and maintainability.
145
255
## Recommended Workflow
146
256
147
257
1. Open the file you want to analyze
148
-
2. Add as context: `:EcaAddFile`
258
+
2. Add as context: `:EcaChatAddFile`
149
259
3. Open chat: `<leader>ec`
150
260
4. Ask your question:
151
261
```markdown
@@ -190,7 +300,7 @@ Consider readability and maintainability.
190
300
## Tips and Tricks
191
301
192
302
### Productivity
193
-
1. Use `:EcaAddFile` before asking about specific code
303
+
1. Use `:EcaChatAddFile` before asking about specific code
194
304
2. Combine contexts: add multiple related files
195
305
3. Be specific: detailed questions generate better responses
196
306
4. Use Markdown: ECA understands Markdown formatting
@@ -230,10 +340,10 @@ Consider readability and maintainability.
0 commit comments