A Neovim plugin that provides seamless integration with Claude Code CLI, allowing you to use Claude directly within your editor through a floating terminal window.
- Floating Terminal: Opens Claude Code in a beautiful floating terminal window
- Toggle Support: Easily show/hide the Claude interface with a simple command
- Smart Window Management: Automatically closes when you switch to another window
- Session Persistence: Maintains your Claude session between toggles
- Neovim 0.5 or higher
- Claude Code CLI installed and configured
Using lazy.nvim
{
"nandoolle/claude-code.nvim",
config = function()
require("claude-code").setup()
end,
}
For better startup performance, you can configure the plugin to load only when needed:
{
"nandoolle/claude-code.nvim",
cmd = "ClaudeCode", -- Load when :ClaudeCode is executed
keys = {
{ "<leader>cc", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude Code" }
},
config = function()
require("claude-code").setup({
keybinding = "<leader>cc" -- Custom keybinding
})
end,
}
Using packer.nvim
use {
"nandoolle/claude-code.nvim",
config = function()
require("claude-code").setup()
end
}
Using vim-plug
Plug 'nandoolle/claude-code.nvim'
" In your init.lua or after plug#end()
lua require('claude-code').setup()
:ClaudeCode
- Toggle the Claude Code floating terminal
<localleader>cc
- Toggle Claude Code (in normal mode)
The plugin works out of the box with sensible defaults. You can customize it using the setup function:
require('claude-code').setup({
-- Custom keybinding (set to nil or false to disable)
keybinding = "<leader>cc", -- Default: "<localleader>cc"
})
keybinding
(string|nil): The keybinding to toggle Claude Code. Set tonil
orfalse
to disable the default keybinding.
-- Use a different keybinding
require('claude-code').setup({
keybinding = "<leader>ai"
})
-- Disable default keybinding (use :ClaudeCode command only)
require('claude-code').setup({
keybinding = false
})
The plugin creates a floating terminal window that runs the claude
command. The window:
- Takes up 80% of your screen width and height
- Centers itself on the screen
- Has rounded borders for a modern look
- Automatically enters insert mode for immediate interaction
- Closes when you switch to another window
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any problems or have feature requests, please file an issue on the GitHub repository.