changes for a better approach
This commit is contained in:
39
README.md
39
README.md
@@ -1,29 +1,20 @@
|
||||
# ChatGPT NeoVim Plugin
|
||||
<!-- README.md -->
|
||||
# ChatGPT NeoVim Plugin (Updated for YAML)
|
||||
|
||||
This plugin helps integrate the ChatGPT O1 model into the development workflow with Neovim.
|
||||
It provides one main interactive command: `:ChatGPT`.
|
||||
This plugin integrates a ChatGPT O1 model workflow into Neovim. It allows you to generate prompts containing:
|
||||
- An **initial prompt** configured via a `.chatgpt_config.yaml` file in your project root.
|
||||
- A list of directories (also specified in the `.chatgpt_config.yaml`) from which it gathers the complete project structure and file contents.
|
||||
- The current file and the project's `README.md`, if present.
|
||||
- It uses YAML for configuration and also expects the ChatGPT response in YAML.
|
||||
|
||||
## :ChatGPT
|
||||
It also respects `.gitignore` entries, skipping those files from the prompt.
|
||||
|
||||
**Workflow:**
|
||||
## Configuration
|
||||
|
||||
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.
|
||||
Create a `.chatgpt_config.yaml` in your project root. For example:
|
||||
|
||||
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.
|
||||
```yaml
|
||||
initial_prompt: "You are a helpful coding assistant that follows instructions meticulously."
|
||||
directories:
|
||||
- "lua"
|
||||
- "plugin"
|
||||
|
||||
Reference in New Issue
Block a user