xonecas.io
7415
Va

vim-ai-complete / commit 188d644

chore: Readme cleanup

xonecas2026-09-10 188d644f31a117c2bc2d72c1281389466e1f8ae1 parent 45cdb7b

1 file changed

README.md+65−36
@@ -2,34 +2,6 @@
22
33 A small Neovim plugin for applying an LLM instruction to selected text.
44
5-## Usage
6-
7-1. Select text in Visual mode.
8-2. Run `:Ai <prompt>`.
9-3. The selected text is replaced when generation succeeds.
10-
11-Run `:Ai` without a prompt to open a multiline input window below the last selected line. Press `<Enter>` to add a line and `<S-Enter>` to submit, including when the prompt is empty. Press `<Esc>` or `<C-c>` to cancel. The status area shows `Generating...` while the blocking LLM command runs.
12-
13-Characterwise, linewise, and blockwise selections are supported. If generation fails, the buffer is left unchanged. A completed replacement is a normal Neovim edit and can be reverted with `u`.
14-
15-### Completion at the cursor
16-
17-Press `<leader>a` in Normal mode to insert a completion at the cursor, before the current character, without selecting text or entering a prompt. The agent receives the current buffer (including unsaved changes) and cursor position, and decides what to insert and whether to read additional context. Generation is blocking, just like `:Ai`.
18-
19-The insertion is a single undoable edit: press `u` to discard it. Failed generation leaves the buffer unchanged. The default mapping is only installed if it does not conflict with an existing Normal-mode mapping.
20-
21-## LLM command
22-
23-The plugin uses `pi` by default. Make sure it is available on Neovim's `$PATH`, or configure another command:
24-
25-```lua
26-require("ai_complete").setup({
27- command = { "my-llm", "--prompt", "{prompt}" },
28-})
29-```
30-
31-The configured command receives the generated prompt and writes replacement text to standard output. `{prompt}` may appear anywhere in the argument list; if omitted, the prompt is appended. For advanced integrations, `command` may be a function that receives the prompt and returns an argument list.
32-
335 ## How to install
346
357 This plugin uses the standard Neovim plugin layout, so it should work with any plugin manager. Make sure `pi` is installed and available on Neovim's `$PATH`, or configure another LLM command.
@@ -84,18 +56,75 @@ cd ~/.config/nvim/pack/local/start
8456 git clone https://github.com/sacenox/vim-ai-complete.git
8557 ```
8658
87-Then restart Neovim.
59+## Usage
60+
61+1. Select text in Visual mode.
62+2. Run `:Ai <prompt>`.
63+3. The selected text is replaced when generation succeeds.
64+
65+Run `:Ai` without a prompt to open a multiline input window below the last selected line. Press `<Enter>` to add a line and `<S-Enter>` to submit, including when the prompt is empty. Press `<Esc>` or `<C-c>` to cancel. The status area shows `Generating...` while the blocking LLM command runs.
66+
67+Characterwise, linewise, and blockwise selections are supported. If generation fails, the buffer is left unchanged. A completed replacement is a normal Neovim edit and can be reverted with `u`.
68+
69+### Completion at the cursor
70+
71+Press `<leader>a` in Normal mode to insert a completion at the cursor, before the current character, without selecting text or entering a prompt. The agent receives the current buffer (including unsaved changes) and cursor position, and decides what to insert and whether to read additional context. Generation is blocking, just like `:Ai`.
72+
73+The insertion is a single undoable edit: press `u` to discard it. Failed generation leaves the buffer unchanged. The default mapping is only installed if it does not conflict with an existing Normal-mode mapping.
74+
75+## LLM command
76+
77+The plugin uses `pi` by default. Make sure it is available on Neovim's `$PATH`, or configure another command:
78+
79+```lua
80+require("ai_complete").setup({
81+ command = { "my-llm", "--prompt", "{prompt}" },
82+})
83+```
84+
85+The configured command receives the generated prompt and writes replacement text to standard output. `{prompt}` may appear anywhere in the argument list; if omitted, the prompt is appended. For advanced integrations, `command` may be a function that receives the prompt and returns an argument list.
86+
87+### Claude Code, Codex, or Cursor
8888
89-## Formatting
89+Choose one configuration below. Install and authenticate the corresponding CLI first, and make sure its executable is on Neovim's `$PATH`. These examples work for both `:Ai` and cursor completion. Use Neovim 0.10+ so stderr (such as CLI progress messages) stays separate from the text inserted into your buffer; the older fallback may mix it into stdout.
9090
91-Use [StyLua](https://github.com/JohnnyMorganz/StyLua) with the repository's `stylua.toml`:
91+#### Claude Code
9292
93-```sh
94-stylua lua/ plugin/
93+```lua
94+require("ai_complete").setup({
95+ command = {
96+ "claude", "-p", "--output-format", "text",
97+ "--tools", "Read,Glob,Grep",
98+ "--strict-mcp-config",
99+ "{prompt}",
100+ },
101+})
102+```
103+
104+Uses print mode with text output, restricts built-in tools to reading/searching, and disables configured MCP servers. See the [Claude Code CLI reference](https://code.claude.com/docs/en/cli-reference).
105+
106+#### Codex CLI
107+
108+```lua
109+require("ai_complete").setup({
110+ command = {
111+ "codex", "exec", "--sandbox", "read-only",
112+ "--color", "never", "{prompt}",
113+ },
114+})
95115 ```
96116
97-To check formatting without changing files:
117+`codex exec` sends progress to stderr and only the final answer to stdout. The explicit read-only sandbox keeps workspace files from being edited by the agent. Run Neovim with its working directory inside a Git repository; to work outside one, add `"--skip-git-repo-check"` before `"{prompt}"`. See [non-interactive mode](https://developers.openai.com/codex/non-interactive-mode) and the [CLI reference](https://developers.openai.com/codex/cli/reference).
98118
99-```sh
100-stylua --check lua/ plugin/
119+#### Cursor CLI
120+
121+```lua
122+require("ai_complete").setup({
123+ command = {
124+ "agent", "--mode=ask", "-p",
125+ "--output-format", "text", "{prompt}",
126+ },
127+})
101128 ```
129+
130+Cursor's CLI executable is `agent`. Ask mode explores code without editing files; print mode with text output returns only the final assistant message. See [CLI modes](https://cursor.com/docs/cli/using) and [output formats](https://cursor.com/docs/cli/reference/output-format).