On Fri, Jul 21, 2006 at 03:19:25PM EDT, A.J.Mechelynck wrote:
> cga2000 wrote:
> >I sometimes need to write text in other languages such as French,
> >Spanish and occasionally German or Italian.
> >
> >I would like to do this in Vim.
> >
> >Unfortunately I only have a US keyboard.
> >
[..]
> I.
> 
> Since you've already used digraphs, and they're too cumbersome for you, 
> you could try a keymap.
> 
> There are some keymaps in $VIMRUNTIME/keymap which you can apply by just 
> doing ":setlocal keymap=<keymapname>" (where <keymapname> is the 
> filename without the encoding and .vim endings) or by using the "Edit -> 
> Keymap" menu. Then you can toggle between "US-QWERTY" mode and "keymap" 
> mode by hitting Ctrl-^ in Insert mode, or by toggling 'iminsert' between 
> zero and 1 in any mode. Basically, what a keymap does is establish a set 
> of language-mappings, i.e., insert-mode mappings which can be turned on 
> an off. Try the "accents" keymap, it might be just what you want.
> 
This works great..! I tried that on a short text in French and within a
couple of minutes I was almost as comfortable as I am when typing in
English.  The accents are all perfectly intuitive - ` ' ^ etc. so I
didn't even need to look at the keymap.  Just need to be a little
patient when entering an apostrophe.

Only minor glitch seems to be that text doesn't wrap when in "INSERT
(lang)" mode.. haven't figured out why yet.. so I just escape out of
insert mode and do a "gqip" once in a while.  Could be unrelated
though..
        
> Or, if none of the distributed keymaps is exactly what you want, you can 
> write your own. It isn't hard. See ":help :loadkeymap" for the theory, 
> and look at the contents of Bram's $VIMRUNTIME/keymap/accents.vim and my 
> $VIMRUNTIME/keymap/esperanto_utf8.vim for a couple of simple examples. 
> You might want to write something more extensive but this will show you 
> how to do it.
> 
Doesn't look like much is missing.. Maybe the French o+e .. but then my
screen font doesn't have it either.. 

> If and when you write your own keymap, place it in the keymap/
> subdirectory of a directory listed early in 'runtimepath' but not in
> $VIMRUNTIME/keymap itself because any upgrade can silently change
> anything there.
> 
> 
> 
> II. What you are suggesting looks like setting 'spelllang' (with three
> ells) to whatever means "French" and then spellchecking your
> US-ASCII-only text. But beware: the Vim spellchecker (which I don't
> use because of my good innate spelling) might not be clever enough to
> mark words which have accented homographs, such as "a" ("has") vs. "à"
> ("at"), "de" ("of") vs. "dé" ("thimble"), "du" ("of the") vs. "dû"
> ("owed"), "cru" ("believed" or "raw") vs. "crû" ("grown") etc.: so the
> cure might be worse than the ill, owing to the necessity of looking
> for unmarked spelling mistakes even after running the spell checker.
> 
I think you're right.  Considering how effective the keymap solution is
there's just no point.  Anyway, I don't even have an active spellchecker
at this point. aspell segfaults for some reason and I haven't had time
to research that yet.

Just need to figure out how I can get latex to handle these non-ASCII
characters. They disappear from the .dvi file.

In case I can't figure it out, there's probably a latex user list
somewhere.

Great Tip..!

Thanks

cga

Reply via email to