A Vim plugin that provides AI-powered writing suggestions with multiple personas, directly integrated into your editor.
- AI-Powered Feedback: Get intelligent writing suggestions from Claude AI
- Multiple Personas: Choose from different writing styles
- Hemingway (direct, concise)
- Formal (professional, structured)
- Academic (scholarly, precise)
- Creative (vivid, engaging)
- General (balanced feedback)
- Color-Coded Suggestions: Each persona's suggestions appear in different colors in the quickfix list
- Multiple Modes:
- Inline suggestions linked to specific lines
- Summary feedback on the entire document
- Detailed comments on writing style
- Quick Access: Keyboard shortcuts for all major functions
- Aggregate Mode: Combine suggestions from all personas in a single view
- Vim 8.0+ or Neovim
- Python 3.13+
- Anthropic API key (for Claude AI access) or OpenAI compatible key (eg litellm)
Plug 'yourusername/vim-ai-suggestions'Plugin 'yourusername/vim-ai-suggestions'- Clone the repository:
git clone https://github.com/yourusername/vim-ai-suggestions.git- Set up the Python script:
mkdir -p ~/bin
cp vim-ai-suggestions/scripts/vim-ai-assistant.py ~/bin/
chmod +x ~/bin/vim-ai-assistant.py-
Install the Python dependencies: The python script uses
uvensure it is installed on your system and it will take care of the rest. -
Create a configuration file with your API key: set in the script directly
-
Install the Vim plugin:
mkdir -p ~/.vim/plugin
cp vim-ai-suggestions/plugin/vim-ai-suggestions.vim ~/.vim/plugin/Add to your .vimrc:
" Set path to the AI assistant script (adjust if needed)
let g:ai_assistant_path = expand('~/bin/vim-ai-assistant.py')
" Optional: Change default persona
let g:ai_current_persona = 'general'
" Optional: Customize available personas
let g:ai_personas = ['general', 'hemingway', 'formal', 'academic', 'creative', 'your_custom_persona']:AISuggest " Get general suggestions in a split window
:AIInline " Get inline suggestions in quickfix list
:AISummary " Get a summary of feedback
:AIAll " Get suggestions from all personas at once (combined view):HemingwaySuggest " Get Hemingway-style suggestions
:FormalInline " Get inline formal suggestions
:AcademicSummary " Get summary in academic style
" etc.:AIPersona hemingway " Switch to Hemingway style
:AIPersona formal " Switch to formal style
" etc.<Leader>as- Get suggestions with current persona<Leader>ai- Get inline suggestions with current persona<Leader>au- Get summary with current persona<Leader>aa- Get suggestions from all personas<Leader>ap- Open persona selection menu
- Edit the Python script to add your persona to the
persona_promptsdictionary:
persona_prompts = {
# ... existing personas ...
"your_persona": "Your custom system prompt describing the personality and focus of this persona",
}- Update your Vim configuration to include the new persona:
let g:ai_personas = ['general', 'hemingway', 'formal', 'academic', 'creative', 'your_persona']The colors for different personas are defined in the s:HighlightAIPersonas() function. You can modify these to match your colorscheme:
highlight qfPersonaHemingway ctermfg=red guifg=#FF5555
highlight qfPersonaFormal ctermfg=yellow guifg=#FFAA55
" etc.If Vim can't find the Python script:
- Check that
g:ai_assistant_pathis set correctly in your.vimrc - Ensure the script has executable permissions (
chmod +x)
If you get errors when running commands:
- Check your internet connection
- Verify your API key is valid
- Check that the Python script can be run from the command line
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for Claude AI
- Vim community for inspiration and support