vim claude code Claude Code CLI integration for Vim
Vim is powerful.
Claude Code CLI is powerful.
So I built a clean integration between them.
vim-claude-code integrates the Claude Code CLI directly inside Vim using the built-in terminal feature.
GitHub: https://github.com/rishi-opensource/vim-claude-code
What this plugin does
This plugin provides a single unified command:
:Claude <subcommand>
It acts as a dispatcher that routes to different Claude-powered workflows.
If no subcommand is provided:
:Claude
It toggles the Claude terminal.
Available subcommands
The plugin currently supports:
Core development
:Claude explain:Claude fix:Claude refactor:Claude test:Claude doc
Git workflows
:Claude commit:Claude review:Claude pr
Architecture and analysis
:Claude plan:Claude analyze
Workflow utilities
:Claude rename:Claude optimize:Claude debug:Claude apply
Meta and system
:Claude chat:Claude context:Claude model:Claude version:Claude doctor:Claude continue:Claude resume:Claude verbose
All subcommands are implemented through a single dispatcher inside plugin/claude_code.vim.
Technical architecture
This plugin is written in Vimscript (not Vim9) and requires:
- Vim 8.0+
-
+terminalsupport
Core architecture:
Core files
plugin/claude_code.vim
Defines the :Claude command and subcommand dispatcher.
autoload/claude_code/*
Modularized logic for:
- commands
- git workflows
- architecture tools
- workflow automation
- terminal integration
- configuration
- utilities
The plugin uses Vim's built-in terminal feature to run Claude Code CLI and manage interaction inside Vim.
It does not depend on:
- Browser APIs
- External UI frameworks
- Neovim-only features
How it works internally
High-level flow:
- User runs
:Claude <subcommand> - Dispatcher parses the first argument
- Routes to the correct autoload module
- Opens or reuses a terminal buffer
- Executes Claude Code CLI with proper context
Visual mode mappings are also supported, so selected code can be sent directly to Claude.
Default keymaps
If enabled in configuration:
Normal mode examples:
<Leader>ce → :Claude explain
<Leader>cf → :Claude fix
<Leader>cr → :Claude refactor
<Leader>ct → :Claude test
<Leader>cd → :Claude doc
There are also mappings for:
- commit
- review
- plan
- analyze
- rename
- optimize
- debug
- chat
- context
- model
All mappings are configurable via plugin config.
Why this plugin is different
- Single clean command dispatcher (
:Claude) - Modular autoload architecture
- Deep Git workflow integration
- Architecture and complexity analysis commands
- Health check via
:Claude doctor - Model switching support
- Terminal-based integration using native Vim features
This is not just a simple AI wrapper.
It is structured around real development workflows.
Requirements
- Vim 8.0+
- Compiled with
+terminal - Claude Code CLI installed and available in PATH
Example usage
Explain selected code:
:Claude explain
Generate tests:
:Claude test
Analyze architecture:
:Claude analyze
Check setup health:
:Claude doctor
Who this is for
- Vim users who want AI assistance inside the editor
- Developers using Claude Code CLI
- Engineers who prefer terminal-native workflows
- People building structured AI-driven development pipelines
Feedback welcome
If you use Vim and Claude Code CLI, I would love feedback.
- Star the repo
- Open issues
- Suggest improvements
Top comments (0)