Saturday, December 25, 2010

Re: AX: change letters on the fly

Reply to message «AX: change letters on the fly»,
sent 01:02:32 26 December 2010, Sunday
by rameo:

> I often write messages in French, German or Italian.
> I found a very nice little software AX to change letters on the fly
> using only a hotkey (F8 or whatever else).
> http://vulpeculox.net/ax/index.htm
>
> It works in editors like notepad, notepad++ but not in gvim.
> Is it because the keystrokes can't be trapped in vim?
> Is there a solution?
>
> Is it possible to do the same with a vim script?
>
> Rameo

I do not know, what AX exactly does, but changing letters on the fly is possible
with my translit3 plugin. It is written for russian language, so you will need
to create a transliteration table for german: install translit3, put the
transliteration table into /path/to/translit3/config/translit3/transsymb-it.json
and add the following to the vimrc:

call load#Setoption('g:tr3Options', 'DefaultTranssymb', 'transsymb-it')

Then you should be able to start input transliteration mode by typing \ts in
normal mode. Example contents of transsymb-it.json:
===== transsymb-it.json =====
{"`": {"e": "è"},
":": {"e": "ë"},
",": {"c": "ç"},
"<": {"<": "«"},
}
=============================
You may also do the following instead of fully manually creating
transsymb-it.json:

:e /path/to/translit3/config/translit3/transsymb-it.json
:call setline('.', '{}')
:w
:call load#Setoption('g:tr3Options', 'DefaultTranssymb', 'transsymb-it')
:Tr3Command add `e è
:Tr3Command add :e ë
:Tr3Command add ,c ç
:Tr3Command add << «

Input transliteration mode does not require you to instantly press `<C-k>', but
you may find inconvenient that by default you cannot add `@' and `%' characters
(first breaks transliteration sequence, so `:@e' will give you `:e', second
pauses transliteration, so `%:e:e%:e' will give you `:e:eë'). First can be
disabled via
call load#Setoption('g:tr3Options', 'BrkSeq', '')
, second via
call load#Setoption('g:tr3Options', 'StopTrSymbs', {})
(second percent sign in the example above is controlled by `StartTrSymbs'
option, but leaving it as-is does not hurt because transliteration cannot be
continued if it cannot be not paused).

No comments: