xonecas.io
7415
Va

vim-ai-complete / commit 5728400

chore: minor language changes

xonecas2026-05-24 57284009d778324a9bba67f453e7108e873b31ac parent f21322c

2 files changed

README.md+9−9
@@ -1,28 +1,28 @@
11 # vim-pi-complete
22
3-A simple Neovim plugin to mimic Cursor's selection prompt and Zed's editor assist feature using the pi coding agent's Non-Interactive mode.
3+A simple Neovim plugin that mimics Cursor's selection prompt and Zed's editor assist feature using the pi coding agent's non-interactive mode.
44
55 ## Pi as your LLM
66
7-Currently the plugin expects `pi` to be installed and ready to use.
7+Currently, the plugin expects `pi` to be installed and ready to use. The arguments this extension sends are the prompt and the read-only tool list, and it sets the thinking level to minimal for speed.
88
99 ## How to use
1010
11-Select a visual block/line/selection and then type `:Pi <you prompt here>`. The selection will be replaced with the model's output.
12-You can give any kind of prompt, but the agent has no edit tools, so it can only reply with the new text, and it's instructed to do so.
13-There is no visual feedback on submit, but if an error happens you will see it.
11+Select a visual block, line, or selection, and then type `:Pi <your prompt here>`. The selection will be replaced with the model's output.
12+You can give any kind of prompt, but the agent has no edit tools, so it can only reply with the new text, and it is instructed to do so.
13+There is no visual feedback on submit, but if an error occurs, you will see it.
1414
15-Just select, prompt and send. Then hope for the best. Each "prompt" is it's own individual session, there is no continuation (you can resume from pi itself).
15+Just select, prompt, and send. Then hope for the best. Each prompt is its own individual session; there is no continuation, though you can resume from pi itself.
1616
1717 ## How to install
1818
19-I know there are many package managers, so please use any that you know, and if I need to make changes to support it, file an issue or PR.
19+I know there are many package managers, so please use any that you know. If I need to make changes to support one, file an issue or PR.
2020
21-Here's how to do it without any package manager:
21+Here's how to do it without a package manager:
2222
2323 ```bash
2424 cd ~/.config/nvim/pack/local/start
2525 git clone <this repo>
2626 ```
2727
28-And restart your nvim :D
28+Then restart Neovim.
lua/pi_complete/init.lua+13−3
@@ -20,7 +20,7 @@ local function prompt_for_pi(user_prompt, selected_text)
2020 -- The actual text selected in Visual mode.
2121 selected_text,
2222 -- The "system" prompt
23- 'Use the information above to generate the exact replacement of the given text above. Return only the exact replacement text. Do not edit the file directly'
23+ 'Generate an exact replacement for the selected text using the user prompt and surrounding file context. Return only the replacement text.'
2424 }, '\n')
2525 end
2626
@@ -51,6 +51,10 @@ function M.complete(user_prompt, has_range)
5151 local selected_text = vim.fn.getreg('z')
5252 local selected_type = vim.fn.getregtype('z')
5353
54+ -- Let the user know Neovim is about to block while pi generates a response.
55+ vim.notify('Pi is generating...', vim.log.levels.INFO)
56+ vim.cmd('redraw')
57+
5458 -- Call the external `pi` program with a prompt built from the user instruction
5559 -- and the selected text from Vim's current working directory. The command's
5660 -- stdout becomes `output`.
@@ -61,8 +65,10 @@ function M.complete(user_prompt, has_range)
6165 'sh',
6266 vim.fn.getcwd(),
6367 'pi',
64- '-tools',
65- 'read',
68+ '-t',
69+ 'read,find,ls,grep',
70+ '--thinking',
71+ 'minimal',
6672 '-p',
6773 prompt_for_pi(user_prompt, selected_text),
6874 })
@@ -82,6 +88,10 @@ function M.complete(user_prompt, has_range)
8288
8389 -- Finally, restore register z so this plugin does not clobber the user's data.
8490 vim.fn.setreg('z', old_z, old_z_type)
91+
92+ -- Let the user know we are done.
93+ vim.notify('Pi is done.', vim.log.levels.INFO)
94+ vim.cmd('redraw')
8595 end
8696
8797 -- Return the module table so Neovim can require() this file and call M.complete().