Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/macrat/askgpt.vim
A plugin for Vim that incorporates ChatGPT to allow you to ask questions about your code.
https://github.com/macrat/askgpt.vim
ai-chatbot chatgpt openai vim vim-plugin
Last synced: 3 months ago
JSON representation
A plugin for Vim that incorporates ChatGPT to allow you to ask questions about your code.
- Host: GitHub
- URL: https://github.com/macrat/askgpt.vim
- Owner: macrat
- License: mit
- Created: 2023-03-03T12:37:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-22T11:15:11.000Z (over 1 year ago)
- Last Synced: 2024-06-15T10:32:26.449Z (5 months ago)
- Topics: ai-chatbot, chatgpt, openai, vim, vim-plugin
- Language: Vim Script
- Homepage:
- Size: 472 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ChatGPT-repositories - askgpt.vim - A plugin for Vim that incorporates ChatGPT to allow you to ask questions about your code. (Browser-extensions)
- awesome-vim-llm-plugins - macrat/askgpt.vim
README
AskGPT.vim
==========A Vim plugin that provides a ChatGPT interface.
![Animation: Ask AskGPT.vim to describe source code](./screenshot.gif)
## Requirements
- Latest Vim with `+job` and `+channel` feature.
- `curl` command.
- OpenAI API key.## How to use
1. Install askgpt.vim plugin using your favorite plugin manager.
2. Set OpenAI API key in your vimrc.
``` vim
" OpenAI API key.
let g:askgpt_api_key = 'xxxxxxxxxxxxxxxx'
```3. Open Vim and execute `:AskGPT` command, or open a `*.askgpt.md` file.
4. Ask your AI assistant anything and press Enter.
Detailed documentation is in [:help askgpt.txt](./doc/askgpt.txt).
## Useful ideas
### Describe source code
1. Select a part of source code in Visual mode.
2. Run `:'<,'>AskGPT What does this function do?`
3. AI will provide a brief description.
4. Ask any question about the code, for example, `How to use it?`### Summarize document
1. Run `:%AskGPT Summarize it`.
2. AI will provide a summary version of the whole document.### Proofread and Enhance text
1. Select a sentence in Visual mode.
2. Run `:'<,'>AskGPT Proofread and enhance it`
3. AI will proofread and suggest improvements.
4. Ask for specific suggestions, for example, `Make it more polite`.### Translate foreign language
1. Select a text in Visual mode.
2. Run `:'<,'>AskGPT Translate it`
3. AI will translate the text you selected.### Convert source code
1. Run `:%AskGPT Translate it to Python`
2. AI will provide a Python version of the source code.### Ask to pretend a role or character
1. Run `:AskGPT` to open a chat window.
2. Type `ggzo` to open the system prompt message.
3. 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.`
4. Enjoy chatting with your chosen persona.