Ondřej Ševčík wrote:
Is it posible to change vim controls to be independent on input characters? I use english and czech keyboard and they have different key layout. Can I translate keys in command mode? I need to ů have same meaning as ; becouse they are on same key. It's really hard to use Vim with czech keyboard, but i need to write thesis in czech of course.
Thanks for advices.


Best Regards.

Ondra


you can test the following in your vimrc, before setting them:

'encoding'
        if &encoding == 'latin1'

":language messages"
        if v:lang =~? '^en' || v:lang == 'C'

":language ctype"
        if v:ctype =~? '\%(iso-8859-1\|latin1\)$'

then depending on the result, either set a 'langmap' (to translate into English the Czech characters input by your Czech keyboard driver) or a 'keymap' (to use an English-language keyboard to input Czech).

'keymap' assumes that your keyboard driver is in English and translates the keypresses in Insert mode but not in Normal mode: e.g., with my "$VIM/vimfiles/keymap/russian-phonetic_utf-8.vim", when I type "Vsego horo%sego" in Insert mode I get "Всего хорошего"; but in Normal mode my "Vim commands" remain in Latin (except the operand of the r command, the search pattern to the / command, etc.). The keymap can be toggled on or off by means of Ctrl-^ in Insert mode or by toggling the 'iminsert' option between 1 and 0.

'langmap' assumes that your keyboard driver is in some foreign language (the help gives an example for Greek) and translates Normal-mode commands, but not Insert-mode text, into English. IIUC, in that case it is not foreseen to set it on in Insert-mode also in order to input English text.

see
        :help expr-option
        :help :language
        :help v:var
        :help 'keymap'
        :help 'langmap'
        :help i_CTRL-^
etc.


Best regards,
Tony.

Reply via email to