Tip #113: Translator in vim (Windows solution)
tip karma |
Rating 1/1, Viewed by 1471
|
created: |
|
September 12, 2001 1:00 |
|
complexity: |
|
basic |
author: |
|
brz* |
|
as of Vim: |
|
5.7 |
Hallo, today I found script "translate.vim", but on Windows this will be probably difficult to run it (maybe with Cygwin is it possible). I've simpler solution of keymap for vim interlacing to dictionary:
Must exist file with vocabulary (e.g. "an-cs.txt"), which is called for word under cursor. In 'normal' is only displayed window with translations, in 'insert' is word under cursor deleted and is insert selected form of word from translantion window (select it by mouse and than press right button: It works fine on W2k). Key _F12_ is looking for "word", shifted _S-F12_ is looking for "pattern".
For windows is needed agrep, which is localy placed on http://www.tgries.de/agrep/index.html
map <F12> b"*yw<Esc>:! c:/bin/agrep -wih <C-R>* "c:/dict/an-cs.txt"<CR>
imap <F12> <Esc>b"*yw<Esc>:! c:/bin/agrep -wih <C-R>* "c:/dict/an-cs.txt"<CR>dwi <C-R>*
map <S-F12> b"*yw<Esc>:! c:/bin/agrep -ih <C-R>* "c:/dict/an-cs.txt"<CR>
imap <S-F12> <Esc>b"*yw<Esc>:! c:/bin/agrep -ih <C-R>* "c:/dict/an-cs.txt"<CR>dwi <C-R>*
brz* <[email protected]>
<<Back and forth between indented lines again |
Browsing by paragraph >>
Additional Notes
|