sponsor Vim development Vim logo Vim Book Ad

transvim.vim : translate a phrase by looking up in a dictionary

 script karma  Rating 82/30, Downloaded by 2468  Comments, bugs, improvements  Vim wiki

created by
Christian Habermann
 
script type
utility
 
description
This script looks up a word/phrase in a dictionary.
User can press key-shortcuts to translate word under cursor, visually selected
text or to be asked for a word.

Search-results are viewed in the same window in which searching
was started. To close a view, press 'q' - TransVim will then
switch back to the buffer comming from.

There are several possibilities to start a translation:
  1) move cursor over word to be translated and press <Leader>tr
  2) visually select word to be translated and press <Leader>tr
  3) press <Leader>ta to be prompted for a word
Memory aid: tr = (T)(R)anslate, ta = (T)ranslate (A)sk for word

By default <Leader> is \, so press \tr, \ta to start  translation.

In order to prevent tremendous huge search-results, the search-string must be at
least 3 characters long (min. length is configurable).
 
install details
Copy this script into your local plugin directory (~/.vim/plugin/).

Set 'g:trv_dictionary' in .vimrc to a plain-ASCII dictionary of your choice
(not included, see script header for further info)
  e.g.: let g:trv_dictionary="~/.vim/dictionary/ger-eng.txt"

'grep' is used for searching, so you need it too.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
transvim.vim 1.0.1 2002-12-08 6.0 Christian Habermann Bug-fix: Removed mapping of <ESC> to close view of results. In
console version of VIM this mapping leaded to close view
after pressing any cursor key - not only after <ESC>.
Now use 'q' instead of <ESC>.
transvim.vim 1.0.0 2002-11-28 6.0 Christian Habermann Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github