feat: changed to and interactive workflow
This commit is contained in:
36
README.md
36
README.md
@@ -1,21 +1,29 @@
|
||||
# ChatGPT NeoVim Plugin
|
||||
|
||||
This Plugin should help the user to integrate ChatGPT o1 model into the development workflow with neovim.
|
||||
It Provides two commands
|
||||
This plugin helps integrate the ChatGPT O1 model into the development workflow with Neovim.
|
||||
It provides one main interactive command: `:ChatGPT`.
|
||||
|
||||
## :ChatGPT
|
||||
This command will ask the user for a prompt.
|
||||
It will then gather the following context:
|
||||
- The project structure based on the git which the currently open file belongs to.
|
||||
- The README.md file content if it exists in the top folder of the project structure.
|
||||
- The currently open file content.
|
||||
|
||||
It also appends to the prompt that every file should be in a code block and the first line of the block
|
||||
should always just contain the file path for the file and nothing else. Regardless if it would destroy the code.
|
||||
**Workflow:**
|
||||
|
||||
The generated prompt for the ChatGPT o1 model, will than be copied to the clipboard and the user will be asked
|
||||
to paste it into the website of ChatGPT.
|
||||
1. **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.md` file content if it exists at the project root.
|
||||
- The currently open file’s content.
|
||||
|
||||
## :ChatGPTPaste
|
||||
This command will look if the clipboard contains a response where the first line is a filepath.
|
||||
It then creates the file and pastes the rest of the response as content into the file.
|
||||
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.
|
||||
|
||||
2. **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.
|
||||
|
||||
3. **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 `y` to process another file (repeat the steps above) or `n` to finish.
|
||||
|
||||
By following this interactive workflow, you can iteratively apply all changes suggested by ChatGPT O1 model directly into your project files without leaving Neovim.
|
||||
|
||||
Reference in New Issue
Block a user