Home

Awesome

translate-shell.vim

Build Status Coverage Status License

Intro

Translate-shell.vim is a plugin for translating text without leaving Vim. It provides a window that displays the translate of word under cursor, selected text or you can use "on fly" translation and translate inserted text. Also, you can save your translate story to file and import it to Anki.

translate-shell.vim screencast

FZF functions:

translate-shell.vim fzf screencast

Table of Contents

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Features

The following features are supported by translate-shell.vim:

Requirements

The following requirements have to be met in order to be able to use translate-shell.vim:

If you would like to use FZF functions that provided by this plugin, you have to install FZF. You can find installation instruction here.

Installation

You can install translate-shell.vim by using any vim plugin manager.

Installation with vim-plug

If you doesn't have installed translate-shell in path, you can install plugin by the following command:

Plug 'echuraev/translate-shell.vim', { 'do': 'wget -O ~/.vim/trans git.io/trans && chmod +x ~/.vim/trans' }

And after it you should specify path to translate-shell by defining g:trans_bin variable e.g:

let g:trans_bin = "~/.vim"

If you already have installed translate-shell in your PATH then it is enough to install plugin by the following command:

Plug 'echuraev/translate-shell.vim'

Getting Started

Translate-shell.vim provides the following commands for translation:

FZF functions:

For more convenience, you can create key mapping for these commands e.g:

inoremap <silent> <leader>t <ESC>:Trans<CR>
nnoremap <silent> <leader>t :Trans<CR>
vnoremap <silent> <leader>t :Trans<CR>
nnoremap <silent> <leader>td :TransSelectDirection<CR>
vnoremap <silent> <leader>td :TransSelectDirection<CR>

Codes of languages you can find here or run the following command:

trans -R

For more information please look at doc/trans.txt or open Vim and run :h trans.

Import history of translating to Anki

You can add history of your translation to Anki and learn new words. Full information you can find on wiki.

TODO List

References

Author

Egor Churaev egor.churaev@gmail.com