A Vim plugin for sending file references from Vim to AI CLI (Claude Code / Gemini CLI) on cmux.
- Send current file path to AI CLI as an
@mentionreference - Send with cursor line number
- Send visually selected line range
- Auto-detect Claude Code / Gemini CLI surface
Plug 'tanabee/cmux.vim'git clone https://github.com/tanabee/cmux.vim.git ~/.vim/pack/plugins/start/cmux.vim:PlugUpdate cmux.vimgit -C ~/.vim/pack/plugins/start/cmux.vim pullOpen two tabs in cmux — one for Vim and the other for AI CLI (Claude Code or Gemini CLI).
| Key | Mode | Action | Example |
|---|---|---|---|
<Leader>c |
Normal | Send file reference | @src/main.ts |
<Leader>c |
Visual | Send file + line range | @src/main.ts:L42-55 |
The default mapping is <Leader>c, but it can be customized via <Plug> mappings (see below).
The AI CLI surface is auto-detected on the first invocation.
| Command | Description |
|---|---|
:CmuxSendFile |
Send file path |
:CmuxSendPos |
Send file path + line number |
:'<,'>CmuxSendRange |
Send file path + line range |
:CmuxDetect |
Re-detect AI CLI surface |
:CmuxSetSurface |
Manually set surface ID |
" Manually specify target surface (usually not needed due to auto-detection)
let g:cmux_surface = 'surface:2'
" Automatically focus the target surface pane after sending (default: 1)
let g:cmux_auto_focus = 0
" Automatically press Enter after sending (default: 0)
let g:cmux_auto_enter = 1If you define <Plug> mappings in your .vimrc, the default <Leader>c bindings are automatically disabled.
nmap <Leader>c <Plug>(cmux-send-file)
nmap <Leader>p <Plug>(cmux-send-pos)
vmap <Leader>c <Plug>(cmux-send-range)- cmux must be installed
- Vim and AI CLI (Claude Code or Gemini CLI) must be running on cmux
MIT