Tuesday, March 2, 2010

Re: Typing accents

On 02/03/10 15:12, John Culleton wrote:
> I set the keymap to accents. Now, how do I type e.g. an acute accent in
> French? I have tried typing 'e and \'e but all I get are those characters.
>
> I am looking for a Vim only solution i.e. that does not require remapping the
> system keyboard.

You have already got three answers all stressing the digraphs solution,
which does not even require installing a keymap. However, you say you
have set the keymap to accents. So let's see if Vim understood it: edit
your French text and type (in Normal mode)

:setlocal keymap?

Vim should reply

keymap=accents

Then type

:setlocal imi?

Vim should reply

iminsert=1

If both the above are OK, then typing 'e i.e apostrophe followed by
small-e-for-echo, in Insert mode, ought to insert an é (e-acute) into
yout text.

Setting the keymap ought to also set 'iminsert' to 1. In Insert mode,
when 'keymap' is nonempty, hitting Ctrl-^ toggles between imi=0 and
imi=1. The value 1 means: use keymaps in Insert/Replace and Command-line
modes, and also for the operands of such Normal-mode commands as r
(replace single character), f (move to the next occurrence of a
character), t (move to just before the next occurrence of a character),
etc. Zero means: never use keymaps (in order to type, for instance,
"l'entrée" where there is both apostrophe-e and e-acute, you would
toggle the setting before typing the word and again in the middle of
it). Normally 'imsearch' is set to -1 which means "in / and ? search
commands, apply the 'iminsert' setting".


So much for the keymap solution. The digraph solution was explained in
the other replies. A third possibility is if your keyboard has a
built-in set of dead keys, not necessarily obvious from what is printed
on the keys: mine, for instance, is shown at
http://users.skynet.be/antoine.mechelynck/other/keybbe.htm and only some
of the dead keys (those needing either AltGr or Shift, or neither, but
not both, and also not AltGr-comma for "cedilla") are printed on the
keys. Of course, to know which dead keys your keyboard might include you
would need to experiment.


Best regards,
Tony.
--
A KNIGHT rides into shot and hacks him to the ground. He rides off.
We stay for a moment on the glade. A MIDDLE-AGED LADY in a C. & A.
twin-set emerges from the trees and looks in horror at the body of her
HUSBAND.
MRS HISTORIAN: FRANK!
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment