Vichat is a Vim plugin for predicting text with OpenAI's GPT-4 model.
- Download the latest version of the plugin from the GitHub repository.
- Unzip the downloaded file.
- Copy the
vichat.vim
file into your~/.vim/plugin
folder. - Set the
OPENAI_API_TOKEN
environment variable with your OpenAI API token.
Once the plugin is installed, you can use the gpt
command to predict text with GPT-4.
To use the command, highlight the text you want to use as the prompt, then enter gpt
. You will then be asked to enter some additional optional text for GPT-4.
Once you enter the additional text, GPT-4 will generate the predicted text and you will be asked if you want to replace or insert the output.
The plugin accesses OpenAI's API. Note that this is different than ChatGPT. Goto openai.com and select API:
Click on the logo and you can find the API keys there:
Setup billing. With each access to the API, they will charge your account depending on which model you select. As of this writing it is aroun 10 cents per request. YMMV.
This plugin is released under the Apache License, Version 2.0. See the LICENSE file for details.