transvim.vim : translate a phrase by looking up in a dictionary
| script karma
Downloaded by 1887
Comments, bugs, improvements
script versions (upload new version)
|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).
|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.
Click on the package to download.
ip used for rating: 184.108.40.206
||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>.