Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tanabee/cmux.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cmux.vim

A Vim plugin for sending file references from Vim to AI CLI (Claude Code / Gemini CLI) on cmux.

Features

  • Send current file path to AI CLI as an @mention reference
  • Send with cursor line number
  • Send visually selected line range
  • Auto-detect Claude Code / Gemini CLI surface

Installation

vim-plug

Plug 'tanabee/cmux.vim'

Manual

git clone https://github.com/tanabee/cmux.vim.git ~/.vim/pack/plugins/start/cmux.vim

Update

vim-plug

:PlugUpdate cmux.vim

Manual

git -C ~/.vim/pack/plugins/start/cmux.vim pull

Usage

Open two tabs in cmux — one for Vim and the other for AI CLI (Claude Code or Gemini CLI).

Key Mappings

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.

Commands

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

Configuration

" 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 = 1

Customizing Key Mappings

If 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)

Prerequisites

  • cmux must be installed
  • Vim and AI CLI (Claude Code or Gemini CLI) must be running on cmux

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors