https://github.com/lordpax/vim-aicli
A Vim plugin for AI-assisted text generation and translation using the aicli command-line tool.
https://github.com/lordpax/vim-aicli
aicli claude gpt mistral openai vim
Last synced: about 2 months ago
JSON representation
A Vim plugin for AI-assisted text generation and translation using the aicli command-line tool.
- Host: GitHub
- URL: https://github.com/lordpax/vim-aicli
- Owner: LordPax
- Created: 2024-09-28T23:51:17.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-02T18:37:50.000Z (over 1 year ago)
- Last Synced: 2025-02-13T16:41:33.746Z (over 1 year ago)
- Topics: aicli, claude, gpt, mistral, openai, vim
- Language: Vim Script
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VimAicli
A Vim plugin for AI-assisted text generation and translation using the aicli command-line tool.
## Features
- Generate AI-powered text directly within Vim
- Translate text to different languages
- Manage context and history for AI interactions
- Integrate files and custom context into AI prompts
## Installation
1. Ensure you have [aicli](https://github.com/LordPax/aicli) installed and accessible in your PATH.
2. Install the plugin using your preferred Vim plugin manager.
For example, using [vim-plug](https://github.com/junegunn/vim-plug):
```viml
Plug 'LordPax/vim-aicli'
```
## Configuration
Add these lines to your `.vimrc`, only if you want a different config for vim :
```viml
let g:aicliprg = "aicli"
let g:ai_text_history = "default"
let g:ai_text_sdk = "your_sdk"
let g:ai_text_model = "your_model"
let g:ai_text_temp = "0.7"
```
## Usage
### General
- `:AiSdk [sdk]` - Set or display the SDK
### Text Generation
- `:AiText` - Generate text interactively
- `:AiText [instruction]` - Generate text based on the instruction
- `:[range]AiText [instruction]` - Use selected text as context for generation
- `:AiText! [instruction]` - Use the entire buffer as context
### Context Management and History for Text Generation
- `:AiAddFile [file2] ...` - Add files to context
- `:AiAddContext [context]` - Add custom context
- `:[range]AiAddContext` - Use selected text as context
- `:AiHistoryClear` - Clear context history
- `:AiHistoryList` - List available history names
- `:AiHistory [name]` - Set or display history name
### Translation
- `:[range]AiTranslate [source]` - Translate text
## Examples
```
:AiText Explain quantum computing
:'<,'>AiText Summarize this text
:AiTranslate fr
:'<,'>AiTranslate es en
:AiAddFile README.md
:AiAddContext We are working on a machine learning project
:AiHistory my_project
```