hanzo.vim

hanzo.vim for Vim/Neovim

AI-powered Vim/Neovim plugin

Installation

Using vim-plug

Plug 'hanzoai/hanzo.vim'

Using lazy.nvim

{
  'hanzoai/hanzo.vim',
  config = function()
    require('hanzo').setup()
  end
}

Manual Installation

git clone https://github.com/hanzoai/hanzo.vim ~/.vim/pack/plugins/start/hanzo.vim

Quick Start

" Set your API key
let g:hanzo_model = 'claude-sonnet-4-20250514'
let g:hanzo_provider = 'anthropic'

" Use :Hanzo or :H to chat
:Hanzo write a hello world function

Features

Commands

Command Description
:Hanzo <prompt> Send prompt to AI
:HanzoComplete Complete code
:HanzoExplain Explain selection
:HanzoRefactor Refactor code
:HanzoFix Fix issues
:HanzoTests Generate tests
:HanzoDocs Generate docs
:HanzoReview Code review

Configuration

" Provider settings
let g:hanzo_provider = 'hanzo'  " hanzo, anthropic, openai, ollama
let g:hanzo_model = 'claude-sonnet-4-20250514'

" API keys (can also use environment variables)
let g:hanzo_api_key = $HANZO_API_KEY

" UI settings
let g:hanzo_sidebar_width = 40
let g:hanzo_sidebar_position = 'right'

" MCP integration
let g:hanzo_mcp_enabled = 1

Keybindings

Key Action
<leader>hc Open chat
<leader>he Explain code
<leader>hr Refactor code
<leader>ht Generate tests

Requirements

License

MIT - See LICENSE