Vim Rosetta banner
mattn mattn

Vim Rosetta

Code Quality community

Description

Vim plugin for translating comments and variable names with Google Translate API. Async translation, popup display, and multi-format name completion.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

vim-rosetta

A Vim plugin that provides translation features for code comments and variable naming using Google Translate API.

Features

  • Comment Translation: Translate code comments under the cursor to any language
  • Word/Selection Translation: Translate the word under cursor or selected text
  • Buffer Translation: Translate entire buffer and display in a new split window
  • Auto Translation: Automatically translate comments on cursor hold
  • Variable Name Completion: Japanese to English translation for variable naming (snake_case, UPPER_CASE, camelCase, PascalCase)
  • Supports multi-line comments
  • Works with various comment styles (//, /* */, #, ")

Installation

Using [vim-plug](https://github.com/junegunn/vim-plug)

Plug 'mattn/vim-rosetta'

Using [dein.vim](https://github.com/Shougo/dein.vim)

call dein#add('mattn/vim-rosetta')

Using Vim 8+ native package manager

mkdir -p ~/.vim/pack/plugins/start
cd ~/.vim/pack/plugins/start
git clone https://github.com/mattn/vim-rosetta.git

Requirements

  • Vim 8.1+ with +popup feature, or Neovim 0.4+
  • curl command

Usage

Comment Translation

https://github.com/user-attachments/assets/668b9c3c-1996-4a66-9aa9-ee92187963eb

Place your cursor on a comment and run:

:RosettaTranslateComment

Or use the default mapping:

tc

Word/Selection Translation

Place your cursor on a word (or select text in visual mode) and use the default mapping:

tt

In visual mode, the selected text will be translated.

Buffer Translation

Translate the entire buffer and display the result in a new vertical split window:

:RosettaTranslateBuffer

Or translate a specific range:

:10,20RosettaTranslateBuffer
:'<,'>RosettaTranslateBuffer  " Visual selection

Auto Translation

Enable automatic translation when cursor stops on a comment:

let g:rosetta_translate_c