Skip to content

0xStabby/chatgpt-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

chatgpt-vim

ChatGPT/OpenAI in Vim
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

Product Name Screen Shot generating a working todo web app with chatgpt-vim

This plugin provides an easy way to use OpenAI's GPT API from within Vim.

It currently provides three commands and three mappings to make it easy to use.

(back to top)

Built With

  • Vim
  • ChatGPT

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • openai api key
  • set openai key env variable, add this in your .bashrc
    export OPENAI_API_KEY=sk-yourapikey

this plugin also relies on the following utils:

  • bash
  • curl
  • jq

(back to top)

Installation

  1. Install with vim plugin manager of your choice

(back to top)

Usage

GPTFile & GPTRun Demo

If there is a ~/.config/openai.token the openai api will be used by default.

Commands

  • :Gpt Prompts the user for a prompt and then uses OpenAI's GPT API or ChatGPT to generate a response.
  • :GptRun Prompts the user for a command to run on the current file and then uses OpenAI's GPT API to generate a response based on the contents of the current file and run log.
  • :GptFile Prompts the user for a prompt and then uses OpenAI's GPT API to generate a response based on the contents of the current file.

Mappings

  • gpt Maps to the :Gpt command.
  • gpr Maps to the :GptRun command.
  • gpf Maps to the :GptFile command.

(back to top)

Roadmap

  • Ask ChatGPT from Vim
  • Review output
  • Write output to file on user Confirmation
  • Hook up to openai api
  • Add more functions
    • Send file contents along with request
    • Send file contents and run log along with request
    • Send visually selected contents along withrequest and replace selected
    • More useful stuff as I think of it

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Twitter: @0xStabby

Project Link: https://github.com/0xStabby/chatgpt-vim

(back to top)