1.8 KiB
ChatGPT NeoVim Plugin
This plugin helps integrate the ChatGPT O1 model into the development workflow with Neovim.
It provides one main interactive command: :ChatGPT.
:ChatGPT
Workflow:
-
Initial Prompt:
When you run:ChatGPT, the plugin asks you for a prompt. After entering the prompt, it gathers context:- The project structure based on the git repository of the currently open file.
- The
README.mdfile content if it exists at the project root. - The currently open file’s content.
It then constructs a combined prompt and automatically copies it to your system clipboard. You will be instructed to paste this prompt into the ChatGPT O1 model’s website.
-
Pasting Prompt into ChatGPT:
Switch to your browser, paste the prompt into ChatGPT’s interface, and submit it. ChatGPT will return one or multiple code blocks. Each code block should start with the file path on the first line, followed by the code. -
Interactive File Pasting:
Return to Neovim. After pressing<Enter>, the plugin enters an interactive mode:- It will prompt you to copy the file path (the first line of the returned code block) into your clipboard and press
<Enter>. - Once you do that, it will store that file path.
- Next, it will ask you to copy the file content (the rest of the returned code block) to your clipboard and press
<Enter>again. - The plugin will then write the pasted content into the file specified by the previously stored path.
- After this file is processed, it asks if you want to paste another file. Press
yto process another file (repeat the steps above) ornto finish.
- It will prompt you to copy the file path (the first line of the returned code block) into your clipboard and press
By following this interactive workflow, you can iteratively apply all changes suggested by ChatGPT O1 model directly into your project files without leaving Neovim.