chatgpt-vim
Use ChatGPT/OpenAI from inside Vim.
git clone https://github.com/0xStabby/chatgpt-vim.git0xStabby/chatgpt-vim
chatgpt-vim
ChatGPT/OpenAI in Vim
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
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.
Built With
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
Installation
- Install with vim plugin manager of your choice
Usage
If there is a ~/.config/openai.token the openai api will be used by default.
Commands
:GptPrompts the user for a prompt and then uses OpenAI's GPT API or ChatGPT to generate a response.:GptRunPrompts 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.:GptFilePrompts 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
gptMaps to the:Gptcommand.gprMaps to the:GptRuncommand.gpfMaps to the:GptFilecommand.
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).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt for more information.
Contact
Twitter: @0xStabby
Project Link: https://github.com/0xStabby/chatgpt-vim
more like this
