claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// Developer Tools

vim-claude-code

Claude CLI integration for Vim, enabling AI-powered coding workflows.

Slowing down
85/100
last commit 3 months ago
last release 3 months ago
releases 8
open issues 3
// install
git clone https://github.com/rishi-opensource/vim-claude-code

vim-claude-code

AI-powered coding, inside Vim. No context switching.

vim-claude-code brings Claude Code directly into your editor. Fix bugs, write tests, review diffs, generate commits, and refactor code — all without leaving Vim.

One keypress opens Claude in a split panel. Another hides it. Your session persists across toggles. Claude edits your files; your buffers reload automatically. You stay in flow.

Why vim-claude-code?

Most AI coding tools pull you out of your editor — into a browser, a chat window, or a separate terminal. vim-claude-code keeps everything inside Vim:

  • No copy-pasting — commands automatically capture your visual selection or current function
  • No tab switching — Claude runs in a managed split, toggled with a single key
  • No blind edits — every file change Claude proposes shows up as a reviewable diff before anything is written to disk
  • No workflow interruption — buffers reload automatically when Claude modifies files

Demos

vim-claude-code highlight reel

Toggle, fix bugs, generate tests, explain code, git workflows, diff preview, terminal zoom, and more — all from within Vim. See DEMO.md for individual feature walkthroughs.

Features at a Glance

Stay in Flow

  • One-key toggle<C-\> opens and hides Claude. Session persists across toggles.
  • Terminal Zoom — Maximize Claude to full-screen with <C-w>z, tmux-style. Restore your split instantly.
  • Auto file refresh — Buffers reload when Claude edits your files. No manual :e needed.
  • Multiple layouts — Right split (default), bottom, top, left, floating popup, or dedicated tab.

Context-Aware Commands

  • Selection-aware — Commands use your visual selection when active, otherwise detect the current function automatically.
  • 22 sub-commands — Explain, fix, refactor, test, document, commit, review, rename, optimize, debug, and more. All tab-completable.
  • Git-aware — Claude starts at your repo root. Separate sessions per repository.

Review Before Claude Writes

  • Diff preview — Every file edit Claude proposes opens a side-by-side diff tab. Review what changes, then accept or reject. You stay in control.

Full Git Workflow

  • Commit messages — Generated from your staged diff, with conventional commit support.
  • Code review — Claude reviews your current diff with configurable strictness and security checks.
  • PR descriptions — Generated from your branch changes without leaving the editor.

Requirements

  • Vim 8+ compiled with +terminal
  • Claude Code CLI installed and in $PATH
  • Optional: +popupwin for floating window mode
  • Optional: python3 for diff preview (:Claude preview)
    • Note: In Windows, there is a default python3 that redirects to the Windows Store. Run Claude doctor to check if you have a valid python3 installation. If you have Python 3, but your installation uses python.exe as the executable, create a python3 symlink.

Installation

Stable release — v1.4.1 Pin to the latest stable release using the examples below, or omit the tag to always track main.

vim-plug

" Always track latest
Plug 'rishi-opensource/vim-claude-code'

" Pin to stable release
Plug 'rishi-opensource/vim-claude-code', { 'tag': 'v1.4.1' }

Vundle

Plugin 'rishi-opensource/vim-claude-code'

Vundle does not support tag pinning. To pin manually after install:

cd ~/.vim/bundle/vim-claude-code && git checkout v1.4.1

pathogen

git clone --branch v1.4.1 https://github.com/rishi-opensource/vim-claude-code.git ~/.vim/bundle/vim-claude-code

Native packages (Vim 8+)

mkdir -p ~/.vim/pack/plugins/start
git clone --branch v1.4.1 https://github.com/rishi-opensource/vim-claude-code.git ~/.vim/pack/plugins/start/vim-claude-code

Quick Start

1. Open Claude:

:Claude
" or press <C-\>

2. Run a health check:

:Claude doctor

This reports [OK] / [FAIL] for every dependency and tells you exactly what to fix.

3. Explore commands with tab completion:

:Claude <Tab>

The Claude session persists — toggling with <C-\> hides and restores the same session.

Commands

Terminal

Open, hide, and manage the Claude terminal session.

CommandDescription
:ClaudeToggle the Claude Code terminal
:Claude continueToggle with --continue (resume last conversation)
:Claude resumeToggle with --resume (interactive conversation picker)
:Claude verboseToggle with --verbose (detailed logging)

Code Intelligence

Commands work on your visual selection when active, or auto-detect the current function.

CommandFlagsDescription
:Claude explain--brief, --detailedExplain selected code or current function
:Claude fix--apply, --safeFix bugs and correctness issues
:Claude refactor--extract, --simplify, --optimize, --renameRefactor code
:Claude test--framework {name}, --edge-casesGenerate unit tests
:Claude doc--inline, --markdownGenerate documentation

Git Workflow

From staged diff to commit message to PR description — without opening a browser.

CommandFlagsDescription
:Claude commit--conventional, --amendGenerate commit message from staged diff
:Claude review--strict, --securityCode review on current diff
:Claude prGenerate PR description

Architecture & Planning

Think through larger problems with Claude before writing code.

CommandDescription
:Claude planGenerate an implementation plan for the current file
:Claude analyzeAnalyze for complexity, performance, and security issues

Workflow Utilities

Direct in-editor actions — apply suggestions, debug errors, rename symbols, or zoom the terminal.

CommandDescription
:Claude renameSuggest better variable/function names
:Claude optimizeOptimize code for performance
:Claude debugAnalyze the error on the current line
:Claude applyApply Claude's last suggestion to the file (prompts for confirmation)
:Claude zoomToggle full-screen (zoom) mode for the Claude terminal

Meta

CommandDescription
:Claude chatSend a free-form message with current file context
:Claude contextPreview what context will be sent to Claude
:Claude model [name]Switch model (sonnet, opus, haiku)

Utility

CommandDescription
:Claude versionShow plugin version, Vim version, Claude CLI version, and terminal support
:Claude doctorHealth check: verifies Claude CLI, Git, terminal support, and Vim version

Reviewing Claude's Edits — Diff Preview

diff preview demo

When Claude proposes changes to a file, a side-by-side diff tab opens automatically before anything is written to disk:

  [current file]    │    [proposed changes]

Review exactly what Claude wants to change, then use these keys in the diff tab:

KeyAction
gaAccept — send y to Claude, apply the change
grReject — send n to Claude, discard the change
qClose the diff tab without responding

Enable diff preview for your project:

:Claude preview install

This registers Claude Code hooks in .claude/settings.local.json. To auto-enable on every Vim startup:

let g:claude_code_diff_preview = 1

Diff preview commands:

CommandDescription
:Claude preview installRegister diff preview hooks in .claude/settings.local.json
:Claude preview uninstallRemove diff preview hooks
:Claude preview closeManually close an open diff tab
:Claude preview statusShow diff preview status and dependency checks

Requires python3. Uses Vim +clientserver for instant diffs when available, falls back to polling.

Full-Screen Focus — Terminal Zoom

zoom demo

Working through a complex problem? Press <C-w>z inside the Claude terminal to maximize it full-screen — just like tmux's zoom. Press again to restore your split layout.

This is especially useful when Claude is generating a long response and you want to read it without distractions.

" Customize the zoom key
let g:claude_code_map_zoom = '<C-w>z'

Keymaps

Default keymaps

ModeKeyAction
Normal<C-\>Toggle Claude Code terminal
Normal<Leader>cCToggle with --continue
Normal<Leader>cVToggle with --verbose
Terminal<C-\>Hide Claude Code terminal
Terminal<C-w>zZoom Toggle: Maximize or restore terminal
Terminal<C-v>Paste: Paste system clipboard content
Terminal<C-h/j/k/l>Navigate to adjacent window

Extended keymaps (g:claude_code_map_extended_prefix + key)

KeyCommandKeyCommand
<Leader>ceexplain<Leader>cGcommit
<Leader>cffix<Leader>cRreview
<Leader>crrefactor<Leader>cppr
<Leader>cttest<Leader>cPplan
<Leader>cddoc<Leader>caanalyze
<Leader>cnrename<Leader>cDdebug
<Leader>cooptimize<Leader>cAapply
<Leader>ccchat<Leader>cxcontext
<Leader>cmmodel

Visual mode: <Leader>c + e/f/r/t/d/n/o operate on the selection.

To disable all default keymaps:

let g:claude_code_map_keys = 0
let g:claude_code_map_extended_keys = 0

Window Layouts

Set g:claude_code_position to match your preferred workflow:

ValueLayout
'right'Vertical split on the right (default)
'bottom'Horizontal split at the bottom
'top'Horizontal split at the top
'left'Vertical split on the left
'float'Floating popup (requires +popupwin)
'tab'Dedicated tab page
" Bottom split at 30%
let g:claude_code_position   = 'bottom'
let g:claude_code_split_ratio = 0.3

" Floating popup
let g:claude_code_position    = 'float'
let g:claude_code_float_width  = 0.85
let g:claude_code_float_height = 0.85
let g:claude_code_float_border = 'double'

Configuration

VariableDefaultDescription
g:claude_code_command'claude'CLI executable
g:claude_code_position'right'Window layout
g:claude_code_split_ratio0.4Terminal size (0.0–1.0)
g:claude_code_enter_insert1Auto-enter Terminal mode on focus
g:claude_code_hide_numbers1Hide line numbers in terminal
g:claude_code_hide_signcolumn1Hide sign column in terminal
g:claude_code_use_git_root1Start Claude at git root
g:claude_code_multi_instance1Separate session per git repo
g:claude_code_map_keys1Register default toggle keymaps
g:claude_code_map_extended_keys1Register <Leader>c* keymaps
g:claude_code_map_toggle'<C-\>'Toggle key
g:claude_code_map_zoom'<C-w>z'Zoom key
g:claude_code_map_paste'<C-v>'Paste key
g:claude_code_map_continue'<Leader>cC'Continue key
g:claude_code_map_verbose'<Leader>cV'Verbose key
g:claude_code_map_extended_prefix'<Leader>c'Prefix for all extended keymaps
g:claude_code_refresh_enable1Auto-reload changed buffers
g:claude_code_refresh_interval1000Polling interval (ms)
g:claude_code_refresh_notify1Notify on buffer reload
g:claude_code_float_width0.8Popup width fraction
g:claude_code_float_height0.8Popup height fraction
g:claude_code_float_border'rounded'Border style
g:claude_code_model''Claude model override
g:claude_code_debug0Enable debug logging to message area
g:claude_code_diff_preview0Auto-start diff preview polling on Vim startup
g:claude_code_bracketed_paste1Enable bracketed paste mode support
g:claude_code_terminal_start_delay300Delay (ms) before attaching to Claude terminal

Buffer-local b:claude_code_* overrides take precedence over g: variables.

Troubleshooting

Run the health check first:

:Claude doctor

This reports [OK] / [FAIL] for each dependency and tells you exactly what to fix.


E117: Unknown function — Run :helptags ALL then restart Vim. Ensure the plugin directory is on your runtimepath.

Terminal does not open — Verify vim --version | grep +terminal. The plugin requires Vim compiled with +terminal.

Claude not found — Ensure claude is in $PATH: which claude.

File changes not detected — Check g:claude_code_refresh_enable is 1 and that autoread is not globally disabled in your vimrc.

Debug logging — Enable verbose output to diagnose issues:

let g:claude_code_debug = 1

All internal events (dispatch, terminal launch, git calls, refresh) will be printed to the message area.

For full in-editor documentation, run :help claude-code.

License

MIT — see LICENSE.

Changelog

See CHANGELOG.md for full details. This project uses semantic-release for automated versioning. See doc/RELEASING.md for details.

// compatibility

Platformscli, api, web
Operating systems
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguageVim Script

// faq

What is vim-claude-code?

Claude CLI integration for Vim, enabling AI-powered coding workflows.. It is open-source on GitHub.

Is vim-claude-code free to use?

vim-claude-code is open-source under the MIT license, so it is free to use.

What category does vim-claude-code belong to?

vim-claude-code is listed under devtools in the Claudeers registry of Claude-compatible tools.

0 views
64 stars
unclaimed
updated 15 days ago

// embed badge

vim-claude-code on Claudeers
[![Claudeers](https://claudeers.com/api/badge/vim-claude-code.svg)](https://claudeers.com/vim-claude-code)

// retro hit counter

vim-claude-code hit counter
[![Hits](https://claudeers.com/api/counter/vim-claude-code.svg)](https://claudeers.com/vim-claude-code)

// reviews

// guestbook

0/500

// related in Developer Tools

🔓

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Curs…

// devtoolsaffaan-m/JavaScript225,699MIT[ claude ]
🔓

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

// devtoolsgarrytan/TypeScript119,234MIT[ claude ]
🔓

AI coding assistant skill (Claude Code, Codex, OpenCode, Cursor, Gemini CLI, and more). Turn any folder of code, SQL schemas, R scripts, shell scripts, docs,…

// devtoolssafishamsi/Python80,484MIT[ claude ]
🔓

🙌 OpenHands: AI-Driven Development

// devtoolsOpenHands/Python79,324NOASSERTION[ claude ]
→ see how vim-claude-code connects across the ecosystem