Files
chatgpt.vim/README.md

1.8 KiB
Raw Blame History

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:

  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 files 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 models website.

  2. Pasting Prompt into ChatGPT:
    Switch to your browser, paste the prompt into ChatGPTs 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.