Can you use Claude Code with Vim or Neovim?
Yes. Claude Code does not need to live inside your editor to work on your code. It reads and edits the files in your project folder directly, so it works alongside Vim or Neovim the same way it works alongside anything else. What you do not get is an official plugin. Anthropic's docs list VS Code and JetBrains as the IDE integrations, with inline diffs and selection sharing. For Vim and Neovim, the good setup is three settings and a split.
This is the sixth entry in my editor series, after the Claude Code VS Code extension, the Claude Code JetBrains plugin, Claude Code in Zed, Claude Code in Cursor and Claude Code in Xcode. Vim is the odd one out, because the best Vim setup is mostly about making Claude Code feel like Vim, not the other way around.
What carries over to Vim and Neovim, based on Anthropic's Claude Code docs
| Feature | VS Code and JetBrains | Vim and Neovim |
|---|---|---|
| Official plugin | Yes | No |
| Claude edits your files | Yes | Yes, directly on disk |
| Diffs in the editor's diff view | Yes | No, review in Claude Code or with git |
| Vim keys in the Claude Code prompt | Yes, with vim editor mode | Yes, with vim editor mode |
| Write long prompts in your own editor | Yes, with Ctrl+G | Yes, with Ctrl+G opening Neovim |
Step 1: turn on vim editor mode in Claude Code
Claude Code has a vim editor mode for its own prompt. Turn it on with /config and change Editor mode to vim. You get NORMAL, INSERT and VISUAL modes, Esc to leave INSERT, and the motions your fingers already know: h, j, k, l, w, b, e, 0, $, gg, G, f and t, plus edits like dd, D, x and dw. In NORMAL mode, j and k move through your command history once the cursor hits the top or bottom of the input.
If you prefer a settings file, put this in ~/.claude/settings.json. The second line is optional and maps jj to Escape in INSERT mode, which the docs support from Claude Code v2.1.208:
{ "editorMode": "vim", "vimInsertModeRemaps": { "jj": "<Esc>" } }
Step 2: make Ctrl+G open Neovim
This is the setting I would not skip. Press Ctrl+G (or Ctrl+X Ctrl+E) in the Claude Code prompt and it opens your prompt in your default text editor. Write it there with full Vim power, save and quit, and the text lands back in the prompt. For a long, careful prompt, like a plan for a feature or a bug report with steps, that is much nicer than typing in a single input box.
Claude Code uses your default editor, so tell your shell what that is. Add export EDITOR=nvim (and export VISUAL=nvim to be safe) to your shell profile, open a new terminal and start Claude Code again. There is also a setting in /config called Show last response in external editor. Turn it on and Claude's previous reply appears above your prompt as commented lines, so you can read it while you write, and Claude Code strips those lines when you save.
If you use fullscreen rendering, pressing v in the transcript viewer writes the whole conversation to a temporary file and opens it in that same editor. Handy when you want to search a long session with / instead of scrolling.
Step 3: run Claude Code beside Neovim
Now put the two side by side. Two ways work well:
- Two panes in your terminal or tmux: Neovim on one side, claude running in the project folder on the other. This is the setup I would start with. It keeps Claude's output out of your buffers and is easy to resize.
- Inside Neovim: open a vertical split, run :terminal, and start claude there. Everything stays in one window. Press Ctrl+\ then Ctrl+N to get out of terminal mode and back to moving between windows.
Either way, start claude from the project root so it picks up your CLAUDE.md. A few lines in there on how you run tests and lint save Claude from guessing every session, and the CLAUDE.md file covers what else to put in it.
Step 4: let Neovim pick up Claude's edits
Claude Code writes straight to disk. If you have the same file open in Neovim, your buffer is now out of date, and if you save over it you throw away Claude's change. Two things prevent that.
- Set autoread in your config (set autoread in init.vim, or vim.o.autoread = true in init.lua). Neovim then reloads a file that changed on disk, as long as you have not changed it yourself.
- Trigger the check. Neovim looks for outside changes at certain moments, such as when you run :checktime or come back to a buffer. Run :checktime after Claude finishes a task, or add an autocommand that runs it when Neovim regains focus or you enter a buffer.
Then review the change. Without an IDE plugin there are no inline diffs, so I review in Claude Code before accepting each edit, and run git diff before I commit. Committing before you hand Claude a big task gives you a clean line to come back to. For anything bigger than a small fix, start in plan mode so you agree on the approach before any file changes.
Should you use Vim with Claude Code, or something else?
Picking an editor setup for Claude Code
| If you... | Use |
|---|---|
| Already live in Vim or Neovim | Claude Code in a split, with vim editor mode and EDITOR=nvim |
| Want inline diffs and selection sharing | The VS Code extension or the JetBrains plugin |
| Are new to coding and to the terminal | The Claude Code desktop app |
| Run several tasks at once | Separate worktrees, one Claude Code session each |
My take: do not switch editors for Claude Code. If Vim is where you are fast, these settings get you most of what the IDE plugins offer, and the part you lose, diffs inside the editor, is covered by reviewing in Claude Code and git. If you are not a Vim person already, do not learn Vim for this. Start in the Claude Code desktop app, which is where I point most people in the club, and come back to editors later. Claude Code day one setup covers the first hour either way, and Claude Code worktrees covers running more than one session without collisions.
Short, practical drops on skills, MCP, agents, prompts, and more. No spam, unsubscribe anytime.
Frequently asked questions
Is there an official Claude Code plugin for Neovim?
No. Anthropic's official IDE integrations are for VS Code and JetBrains. With Neovim you run Claude Code beside your editor, in a terminal pane or a :terminal split, and it edits your project files directly.
How do I turn on vim mode in Claude Code?
Run /config and set Editor mode to vim, or add "editorMode": "vim" to ~/.claude/settings.json. You get NORMAL, INSERT and VISUAL modes and the common Vim motions and edits in the Claude Code prompt.
How do I write Claude Code prompts in Neovim?
Set EDITOR=nvim in your shell profile, restart Claude Code, and press Ctrl+G in the prompt. Your prompt opens in Neovim, and when you save and quit the text goes back into Claude Code.
Why doesn't Neovim show the changes Claude Code made?
Neovim keeps your open buffer until it checks the file on disk. Turn on autoread and run :checktime, or add an autocommand that runs it when you return to Neovim, so Claude's edits load into your buffers.
Does jj to escape work in Claude Code?
Yes, from v2.1.208, with "vimInsertModeRemaps": { "jj": "<Esc>" } in your user settings file. Claude Code ignores this setting in a project's .claude settings files.
Last reviewed by David Iya on October 15, 2026

