feat: change te chatgpt config for better coding, update the readme
This commit is contained in:
40
README.md
40
README.md
@@ -1,20 +1,46 @@
|
||||
<!-- README.md -->
|
||||
# ChatGPT NeoVim Plugin (Updated for YAML)
|
||||
# ChatGPT NeoVim Plugin (Updated for YAML and Default Prompt Blocks)
|
||||
|
||||
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.
|
||||
- The content of the current file you are editing and the project's `README.md`, if present.
|
||||
- Prompts are combined and copied to your clipboard, ready to be pasted into ChatGPT O1.
|
||||
|
||||
It also respects `.gitignore` entries, skipping those files from the prompt.
|
||||
The ChatGPT O1 model is then expected to return modifications in a **YAML** format. You will then use the `:ChatGPTPaste` command to read these changes from the clipboard and apply them to your files.
|
||||
|
||||
## Configuration
|
||||
## Default Prompt Blocks
|
||||
|
||||
Create a `.chatgpt_config.yaml` in your project root. For example:
|
||||
The configuration now supports specifying one or more "default prompt blocks." These blocks allow you to quickly switch between different kinds of specialized instructions for ChatGPT. For example:
|
||||
- **go-development**: Focused on Go (Golang) coding best practices, idiomatic patterns, and Go-specific guidance.
|
||||
- **typo3-development**: Focused on TYPO3 development practices, TypoScript, and extension coding guidelines.
|
||||
- **basic-prompt**: A generic prompt that explains how to return modifications in the required YAML structure.
|
||||
|
||||
If you specify multiple blocks in `default_prompt_blocks`, their instructions are concatenated. This lets you combine multiple focus areas or start with a base prompt and add a specialized layer on top.
|
||||
|
||||
## Example Configuration
|
||||
|
||||
Below is an example `.chatgpt_config.yaml` that sets a custom initial prompt, limits directories to scan, and selects default prompt blocks:
|
||||
|
||||
```yaml
|
||||
initial_prompt: "You are a helpful coding assistant that follows instructions meticulously."
|
||||
initial_prompt: "You are a coding assistant who will provide modifications in YAML form."
|
||||
directories:
|
||||
- "lua"
|
||||
- "plugin"
|
||||
default_prompt_blocks:
|
||||
- "basic-prompt"
|
||||
- "go-development"
|
||||
```
|
||||
|
||||
With this configuration:
|
||||
- The prompt shown to ChatGPT will include both the "basic-prompt" and "go-development" instructions, as well as the user’s message.
|
||||
- Only the `lua` and `plugin` directories of your project will be included in the prompt.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Run `:ChatGPT` and enter your message. The combined prompt is copied to your clipboard.
|
||||
2. Paste it into the ChatGPT O1 model.
|
||||
3. Copy the YAML response from ChatGPT into your clipboard.
|
||||
4. Run `:ChatGPTPaste` to apply the changes to your files.
|
||||
|
||||
This workflow allows you to iterate quickly, making changes guided by AI while keeping a clear history and a structured approach.
|
||||
|
||||
Reference in New Issue
Block a user