-
Notifications
You must be signed in to change notification settings - Fork 393
Text Editor Integration
trans
is a command-line program which can be easily integrated with any text editor. Below are some useful tips.
Feel free to add to the list if you have done amazing things integrating Translate Shell with your favorite editor. (Vim scripts, Emacs modes, Atom packages, Sublime Text plugins, or anything else!)
You can, of course, use Emacs as a front-end of the Interactive Translate Shell, in the same way you emulate your favorite shell with M-x shell. There is a shortcut for starting Emacs with an interactive Translate Shell session:
$ trans -emacs
When editing a text file, viewing the translation of a region is just one single command: (translating to Japanese, for example)
M-| trans :ja
There is a (really) simple minor mode for Emacs google-translate-mode.el which you may use as a starting point.
- C-c - Show translation of the current word in message buffer.
- C-c = View verbose translation of the current word in popup dialog.
- C-c + Insert translation of the current word after the current position.
- vim-translate a tiny translate-shell wrapper for Vim.
- translate-shell.vim is a power and flexible 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.
-
vim-translator is an asynchronous translating plugin for Vim/Neovim, it allows users to use multiple engines including
trans
Add this line to your ~/.vimrc
: (translating to Japanese, for example)
set keywordprg=trans\ :ja
Use Shift-K to view the translation of the word under the cursor.