Preben Randhol wrote:
Hi

I'm using Vim to write Greek text. I found a nice tip at:
http://betabug.ch/blogs/ch-athens/270
on how to get Vim to accept greek letters as commands. Just using maps
basicly so it is quite easy.

The problem is that I would like to be able to translate in insert mode
the following:
imap <C-ο> <C-o>
imap <C-κ> <C-k>
imap <C-π> <C-p>

but it doesn't work. I get only ο, κ and π.

Why?

Thanks in advance

Preben


I believe that this is an OS problem rather than a Vim problem. To see what (if any) Vim sees when you hit kappa, omikron or pi with the Ctrl key being depressed, hit the key combination in question prefixed by Ctrl-V in Insert mode (and if your Ctrl-V is mapped to the paste operation, use Ctrl-Q instead). If Ctrl-V Ctrl-kappa enters a plain kappa into your buffer, it means that your keyboard interface transmits the same thing to Vim for Ctrl-kappa and for kappa, and in that case Vim cannot tell them apart. If you are running gvim, Vim in an xterm interfacing through the X-windows server, or Vim in Windows, then Xmodmap or some "international keyboard" GUI utility might perhaps help you. In the pure-text console /dev/tty on Linux, you may need to hack the keyboard map which is loaded at some point during the init bootup process.

If your OS "locale" is normally set to some Latin-alphabet locale (such as "de_DE.ISO-8859-1" or "French_Belgium.1252"), you don't need to change that to be able to input Greek into Vim in Insert mode: see

        :help mbyte-keymap
        :help 'keymap'
        :help digraph.txt
        :help i_CTRL-V_digit

Of course, you will first need to make sure that your 'encoding' includes the Greek alphabet; but the great thing about this method is that your Latin keyboard remains active in Normal and Visual modes, so that you don't get any headaches using Vim in that mode. In effect, a keymap is a set of "language mappings", i.e., mappings which apply only in Insert/Replace mode, in Command-line mode, and for the "text" operand of a few Normal-mode commands like r f t etc., and which can be toggled on and off at will, by using Ctrl-^ in Insert mode or by toggling the 'iminsert' option by means of the ":set" or ":setlocal" commands in Normal mode.


Best regards,
Tony.

Reply via email to