41 lines
927 B
Markdown
41 lines
927 B
Markdown
# Claude Vim Filter Plugin
|
|||
|
|
|
||
|
|
Transform selected text in Vim/Neovim using Claude Code's `claude -p` command.
|
||
|
|
|
||
|
|
## What It Does
|
||
|
|
|
||
|
|
Select any text in Vim, press a keybinding, type an instruction (like "fix syntax" or "improve variable names"), and Claude transforms it instantly. Text is passed safely via stdin, so all special characters, quotes, newlines, and unicode work without escaping.
|
||
|
|
|
||
|
|
## Install
|
||
|
|
|
||
|
|
```bash
|
||
|
|
cd /path/to/vimai
|
||
|
|
python3 install.py
|
||
|
|
```
|
||
|
|
|
||
|
|
The installer auto-detects Vim or Neovim and copies the plugin to the right location.
|
||
|
|
|
||
|
|
## Usage
|
||
|
|
|
||
|
|
1. **Select text** - Visual mode: `V` + arrow keys
|
||
|
|
2. **Press `<leader>a`** - Default leader is `,` (comma)
|
||
|
|
3. **Type instruction** - Describe what you want
|
||
|
|
4. **Press Enter** - Done
|
||
|
|
|
||
|
|
**Examples:**
|
||
|
|
```vim
|
||
|
|
fix syntax errors
|
||
|
|
add type hints
|
||
|
|
improve variable names
|
||
|
|
convert to uppercase
|
||
|
|
fix grammar
|
||
|
|
```
|
||
|
|
|
||
|
|
Or use the command directly:
|
||
|
|
```vim
|
||
|
|
:ClaudeFilter add docstring
|
||
|
|
```
|
||
|
|
|
||
|
|
That's it.
|
||
|
|
|