A Vim plugin that provides a ChatGPT interface.
- Latest Vim with
+job
and+channel
feature. curl
command.- OpenAI API key.
-
Install askgpt.vim plugin using your favorite plugin manager.
-
Set OpenAI API key in your vimrc.
" OpenAI API key. let g:askgpt_api_key = 'xxxxxxxxxxxxxxxx'
-
Open Vim and execute
:AskGPT
command, or open a*.askgpt.md
file. -
Ask your AI assistant anything and press Enter.
Detailed documentation is in :help askgpt.txt.
- Select a part of source code in Visual mode.
- Run
:'<,'>AskGPT What does this function do?
- AI will provide a brief description.
- Ask any question about the code, for example,
How to use it?
- Run
:%AskGPT Summarize it
. - AI will provide a summary version of the whole document.
- Select a sentence in Visual mode.
- Run
:'<,'>AskGPT Proofread and enhance it
- AI will proofread and suggest improvements.
- Ask for specific suggestions, for example,
Make it more polite
.
- Select a text in Visual mode.
- Run
:'<,'>AskGPT Translate it
- AI will translate the text you selected.
- Run
:%AskGPT Translate it to Python
- AI will provide a Python version of the source code.
- Run
:AskGPT
to open a chat window. - Type
ggzo
to open the system prompt message. - Edit the prompt to specify a role or character.
For example:
You are a wise mentor. Help the user with useful questions.
You are a bigoted philosopher. Discuss complex ideas.
- Enjoy chatting with your chosen persona.